Re: [PATCH 02/10] iio: gyro: hid-sensor-gyro-3d: use local struct device
From: Andy Shevchenko
Date: Mon Jul 20 2026 - 08:37:40 EST
On Mon, Jul 20, 2026 at 03:10:14PM +0530, Sanjay Chitroda via B4 Relay wrote:
> Introduce a local struct device pointer derived from &pdev->dev.
> This avoids repeated &pdev->dev usage and improves readability.
...
> if (ret) {
> - dev_err(&pdev->dev, "failed to setup common attributes\n");
> + dev_err(dev, "failed to setup common attributes\n");
> return ret;
Nope, First one (to eliminate a lot of churn) should be to convert this and
similar to use
return dev_err_probe(...);
> }
>
> - indio_dev->channels = devm_kmemdup(&pdev->dev, gyro_3d_channels,
> + indio_dev->channels = devm_kmemdup(dev, gyro_3d_channels,
> sizeof(gyro_3d_channels), GFP_KERNEL);
> if (!indio_dev->channels) {
> - dev_err(&pdev->dev, "failed to duplicate channels\n");
> + dev_err(dev, "failed to duplicate channels\n");
And this kind of messages are dead code and must be just removed completely.
> return -ENOMEM;
> }
...
Please, revisit the whole series.
--
With Best Regards,
Andy Shevchenko