[PATCH v3 058/108] pwm: imx27: Make use of devm_pwmchip_alloc() function

Uwe Kleine-König u.kleine-koenig at pengutronix.de
Tue Dec 5 04:14:04 PST 2023


Hello Philipp,

On Tue, Dec 05, 2023 at 12:49:19PM +0100, Philipp Zabel wrote:
> On Di, 2023-11-21 at 14:50 +0100, Uwe Kleine-König wrote:
> > @@ -306,13 +308,15 @@ MODULE_DEVICE_TABLE(of, pwm_imx27_dt_ids);
> >  
> >  static int pwm_imx27_probe(struct platform_device *pdev)
> >  {
> > +	struct pwm_chip *chip;
> >  	struct pwm_imx27_chip *imx;
> >  	int ret;
> >  	u32 pwmcr;
> >  
> > -	imx = devm_kzalloc(&pdev->dev, sizeof(*imx), GFP_KERNEL);
> > -	if (imx == NULL)
> > -		return -ENOMEM;
> > +	chip = devm_pwmchip_alloc(&pdev->dev, 1, sizeof(*imx));
> > +	if (IS_ERR(chip))
> > +		return PTR_ERR(chip);
> > +	imx = pwmchip_priv(chip);
> 
> Please use to_pwm_imx27_chip() here. Otherwise,
> 
> Reviewed-by: Philipp Zabel <p.zabel at pengutronix.de>

Thanks. This is already fixed in my tree for this and a few other
drivers. Currently the patch looks as follows:

	https://git.pengutronix.de/cgit/ukl/linux/commit/?h=pwm-lifetime-tracking&id=4fa8c8a8661fa6d91de0368693d4a92907fb5359

The only other changes since this v3 is the usage of
pwmchip_get_drvdata() instead of pwmchip_priv(). Can I keep your
Reviewed-by for this new variant?

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20231205/9c516f0c/attachment.sig>


More information about the linux-arm-kernel mailing list