[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75VdmXa3njJFkbsgLX3G2Auh_6ive1dHQyEvTf26ft_riTA@mail.gmail.com>
Date: Tue, 3 Sep 2024 13:38:09 +0300
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: Lorenzo Bianconi <lorenzo@...nel.org>
Cc: Jonathan Cameron <Jonathan.Cameron@...wei.com>, David Lechner <dlechner@...libre.com>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Michael Hennerich <michael.hennerich@...log.com>, Antoniu Miclaus <antoniu.miclaus@...log.com>,
Jinjie Ruan <ruanjinjie@...wei.com>,
Srinivas Pandruvada <srinivas.pandruvada@...ux.intel.com>,
Basavaraj Natikar <Basavaraj.Natikar@....com>, linux-input@...r.kernel.org,
linux-iio@...r.kernel.org, linux-kernel@...r.kernel.org,
Jiri Kosina <jikos@...nel.org>, Jonathan Cameron <jic23@...nel.org>,
Lars-Peter Clausen <lars@...afoo.de>
Subject: Re: [PATCH v1 14/22] iio: imu: st_lsm6dsx: Get platform data via dev_get_platdata()
On Tue, Sep 3, 2024 at 10:11 AM Lorenzo Bianconi <lorenzo@...nel.org> wrote:
...
> > struct device *dev = hw->dev;
> > + const struct st_sensors_platform_data *pdata = dev_get_platdata(dev);
>
> nit: I guess you can move pdata pointer in the 'if' block, since it is just
> used there.
Yes, but it will increase the LoCs number by 3 for no benefit for each
of such cases.
> > int err = 0, drdy_pin;
> >
> > - if (device_property_read_u32(dev, "st,drdy-int-pin", &drdy_pin) < 0) {
> > - struct st_sensors_platform_data *pdata;
> > -
> > - pdata = (struct st_sensors_platform_data *)dev->platform_data;
> > + if (device_property_read_u32(dev, "st,drdy-int-pin", &drdy_pin) < 0)
> > drdy_pin = pdata ? pdata->drdy_int_pin : 1;
> > - }
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists