[PATCH v11 1/7] firmware: smccc: Add an Arm SMCCC bus

Jonathan Cameron jonathan.cameron at oss.qualcomm.com
Wed Sep 23 09:43:10 PDT 2026


On Tue, 15 Sep 2026 08:46:01 -0300
Jason Gunthorpe <jgg at nvidia.com> wrote:

> On Tue, Sep 15, 2026 at 02:52:14PM +0530, Aneesh Kumar K.V wrote:
> 
> > > Yes, but as written it is OK, and this is a common pattern in the
> > > kernel. I agree it is fragile tricky..
> > >
> > > Still it isn't an urgent reason to change it around, but the best
> > > pattern is to put the allocate, dev.release=, and device_initialize()
> > > in one 'alloc' function. Then the other function calls it and always
> > > unwinds with put_device. Use device_add().
> > >
> > > This avoids mixing the different kfree/put_device error unwind regimes
> > > into the same function..
> > >  
> > 
> > Something like  
> 
> Yeah, this is the safest way I know to use these interfaces
> 
Agreed.

> Jason




More information about the linux-arm-kernel mailing list