Re: [PATCH] iio: ad4310: Replace devm_clk_register() with devm_clk_hw_register()

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

 



On Sun, 9 Apr 2023 11:25:28 -0700
Lars-Peter Clausen <lars@xxxxxxxxxx> wrote:

> On 3/26/23 08:25, Jonathan Cameron wrote:
> > On Sun, 26 Mar 2023 07:20:46 -0700
> > Lars-Peter Clausen <lars@xxxxxxxxxx> wrote:
> >  
> >> The devm_clk_register() is deprecated and devm_clk_hw_register() should be
> >> used as a replacement.
> >>
> >> Signed-off-by: Lars-Peter Clausen <lars@xxxxxxxxxx>  
> > Applied
> >  
> I've noticed a bug in this driver. It never removes the clock provider. 
> A backportable fix for that conflicts with this patch. Can we drop this 
> patch for now and re-apply it after the fix?

Hopefully this won't cause anyone too much trouble as that was pushed out
as a supposedly non rebasing branch.

Patch dropped.

> >  
> >> ---
> >>   drivers/iio/adc/ad4130.c | 11 ++++++-----
> >>   1 file changed, 6 insertions(+), 5 deletions(-)
> >>
> >> diff --git a/drivers/iio/adc/ad4130.c b/drivers/iio/adc/ad4130.c
> >> index 38394341fd6e..f23b7808e996 100644
> >> --- a/drivers/iio/adc/ad4130.c
> >> +++ b/drivers/iio/adc/ad4130.c
> >> @@ -1823,7 +1823,7 @@ static int ad4130_setup_int_clk(struct ad4130_state *st)
> >>   	struct device_node *of_node = dev_of_node(dev);
> >>   	struct clk_init_data init;
> >>   	const char *clk_name;
> >> -	struct clk *clk;
> >> +	int ret;
> >>   
> >>   	if (st->int_pin_sel == AD4130_INT_PIN_CLK ||
> >>   	    st->mclk_sel != AD4130_MCLK_76_8KHZ)
> >> @@ -1839,11 +1839,12 @@ static int ad4130_setup_int_clk(struct ad4130_state *st)
> >>   	init.ops = &ad4130_int_clk_ops;
> >>   
> >>   	st->int_clk_hw.init = &init;
> >> -	clk = devm_clk_register(dev, &st->int_clk_hw);
> >> -	if (IS_ERR(clk))
> >> -		return PTR_ERR(clk);
> >> +	ret = devm_clk_hw_register(dev, &st->int_clk_hw);
> >> +	if (ret)
> >> +		return ret;
> >>   
> >> -	return of_clk_add_provider(of_node, of_clk_src_simple_get, clk);
> >> +	return of_clk_add_hw_provider(of_node, of_clk_hw_simple_get,
> >> +				      &st->int_clk_hw);
> >>   }
> >>   
> >>   static int ad4130_setup(struct iio_dev *indio_dev)  
> 
> 




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux