[PATCH v2 1/2] i2c: xiic: switch to generic device property accessors
Andy Shevchenko
andriy.shevchenko at intel.com
Thu Jan 22 01:03:50 PST 2026
On Thu, Jan 22, 2026 at 11:00:01AM +0200, Andy Shevchenko wrote:
> On Thu, Jan 22, 2026 at 08:32:31AM +0000, Abdurrahman Hussain via B4 Relay wrote:
...
> > - i2c = devm_kzalloc(&pdev->dev, sizeof(*i2c), GFP_KERNEL);
> > + i2c = devm_kzalloc(dev, sizeof(*i2c), GFP_KERNEL);
> > if (!i2c)
> > return -ENOMEM;
>
> This type of changes should go in a separate patch after this one.
...
> > mutex_init(&i2c->lock);
>
> Please, consider also switching this (in yet another separate patch) to
> devm_mutex_init().
...
> > - ret = devm_request_threaded_irq(&pdev->dev, irq, NULL,
> > - xiic_process, IRQF_ONESHOT,
> > - pdev->name, i2c);
> > + ret = devm_request_threaded_irq(dev, irq, NULL, xiic_process,
> > + IRQF_ONESHOT, pdev->name, i2c);
> >
> > if (ret < 0) {
>
> > - dev_err_probe(&pdev->dev, ret, "Cannot claim IRQ\n");
> > + dev_err_probe(dev, ret, "Cannot claim IRQ\n");
> > goto err_pm_disable;
>
> Before doing it, just kill the message, it is a dup since devm_request_*irq*()
> already prints the similar one on the error cases.
>
> > }
...
> So, this patch should be transformed to three
Ah, to four!
(in the following order)
- convert to devm_mutex_init()
> - removing a dup message
> - converting to device propries
> - utilising the temporary 'dev' variable elsewhere
--
With Best Regards,
Andy Shevchenko
More information about the linux-arm-kernel
mailing list