Re: [PATCH v4 2/6] iio: light: stk3310: handle all remove logic with devm callbacks

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Nov 04, 2024 at 10:32:08AM +0200, Andy Shevchenko wrote:
> On Sat, Nov 02, 2024 at 03:50:37PM -0400, Aren Moynihan wrote:
> > Using devm callbacks helps to make the ordering of probe / remove
> > operations easier to reason about and removes some duplicate code
> > between the probe error path and driver remove.
> 
> Where is SoB?

Oops that got lost in a rebase

> ...
> 
> > +	ret = devm_add_action_or_reset(&client->dev, stk3310_set_state_disable, data);
> 
> Why not simply 'dev' as in below call?

I was trying to avoid refactoring the entire function to replace
&client->dev with dev, I'll add a patch for that to the next revision.

> > +	if (ret)
> > +		return dev_err_probe(dev, ret, "failed to register cleanup function\n");
> 
> ...
> 
> > -	mutex_init(&data->lock);
> > +	devm_mutex_init(&client->dev, &data->lock);
> 
> Missed error check, otherwise what's the point?
> 
> 
> Also can add a temporary variable for 'dev'.

Yup, fixing... I need to read the docs / function type more carefully
sometimes.

Thanks
 - Aren




[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux