Messages in this thread |  | | From | Rosen Penev <> | | Date | Tue, 5 May 2026 15:43:06 -0700 | | Subject | Re: [PATCHv2] talitos: allocate channels with main struct |
| |
On Tue, May 5, 2026 at 1:23 AM Herbert Xu <herbert@gondor.apana.org.au> wrote: > > On Tue, May 05, 2026 at 12:37:05AM -0700, Rosen Penev wrote: > > Use a flexible array member to combine allocations. > > > > Add __counted_by for extra runtime analysis. > > > > Signed-off-by: Rosen Penev <rosenp@gmail.com> > > --- > > v2: add check for of_property_read_u32 > > drivers/crypto/talitos.c | 19 +++++++------------ > > drivers/crypto/talitos.h | 5 +++-- > > 2 files changed, 10 insertions(+), 14 deletions(-) > > > > diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c > > index bc61d0fe3514..e1f009684216 100644 > > --- a/drivers/crypto/talitos.c > > +++ b/drivers/crypto/talitos.c > > @@ -3409,14 +3409,20 @@ static int talitos_probe(struct platform_device *ofdev) > > struct device *dev = &ofdev->dev; > > struct device_node *np = ofdev->dev.of_node; > > struct talitos_private *priv; > > + unsigned int num_channels; > > int i, err; > > int stride; > > struct resource *res; > > > > - priv = devm_kzalloc(dev, sizeof(struct talitos_private), GFP_KERNEL); > > + if (of_property_read_u32(np, "fsl,num-channels", &num_channels)) > > + num_channels = 0; > > Does this driver still work with zero channels? It should just fail > the probe. I looked through the dts files. All of them have this property. I'll have the change. > > Thanks, > -- > Email: Herbert Xu <herbert@gondor.apana.org.au> > Home Page: http://gondor.apana.org.au/~herbert/ > PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
|  |