Re: [PATCH v2 02/17] tee: Add probe, remove and shutdown bus callbacks to tee_client_driver

From: Uwe Kleine-König
Date: Wed Dec 17 2025 - 06:40:48 EST


Hello Sumit,

On Wed, Dec 17, 2025 at 02:24:55PM +0530, Sumit Garg wrote:
> On Mon, Dec 15, 2025 at 03:16:32PM +0100, Uwe Kleine-König wrote:
> > +static void tee_client_device_shutdown(struct device *dev)
> > +{
> > + struct tee_client_device *tcdev = to_tee_client_device(dev);
> > + struct tee_client_driver *drv = to_tee_client_driver(dev->driver);
> > +
> > + if (dev->driver && drv->shutdown)
>
> Is check for dev->driver really needed here? I think we only reach this
> stage if a driver is associated to the device. Also, it has been
> dereferenced above too.

Yes, this is needed. See device_shutdown() which calls the bus shutdown
method also for unbound drivers.

And no it has not been dereferenced above, to_tee_client_driver() is
just a subtraction from the literal value, this doesn't count as
dereference.

> Apart from this, rest looks fine to me. Feel free to add:
>
> Reviewed-by: Sumit Garg <sumit.garg@xxxxxxxxxxxxxxxx>

Thanks
Uwe

Attachment: signature.asc
Description: PGP signature