lkml.org 
[lkml]   [2022]   [May]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v1 3/3] iio: adc: meson_saradc: Use temporary variable for struct device
Hi Andy,

On Tue, May 31, 2022 at 11:18 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
[...]
> @@ -650,11 +648,12 @@ static int meson_sar_adc_clk_init(struct iio_dev *indio_dev,
> void __iomem *base)
> {
> struct meson_sar_adc_priv *priv = iio_priv(indio_dev);
> + struct device *idev = &indio_dev->dev;
> + struct device *dev = dev->parent;
It looks like this should read:
struct device *dev = idev->parent;

That said, I think this kind of typo is very easy with the current
naming schema.
It's been a while since I looked at other drivers but maybe the IIO
maintainers have some recommendations for us (which would apply to
multiple IIO drivers, not just meson_saradc).
For example: I am not sure if iio_{err,warn} functions (which take a
struct iio_dev pointer) have been proposed/discussed before. I think
they could be useful for other drivers as well.


Best regards,
Martin

\
 
 \ /
  Last update: 2022-05-31 23:48    [W:0.077 / U:0.428 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site