[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75VckN1uK+Z6wMF=XGLROA1wn0TO3wXGaeEdnSgAxdsoFmw@mail.gmail.com>
Date: Mon, 1 Nov 2021 12:51:52 +0200
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: Hans de Goede <hdegoede@...hat.com>
Cc: "Rafael J . Wysocki" <rjw@...ysocki.net>,
Mark Gross <markgross@...nel.org>,
Andy Shevchenko <andy@...radead.org>,
Wolfram Sang <wsa@...-dreams.de>,
Mika Westerberg <mika.westerberg@...ux.intel.com>,
Daniel Scally <djrscally@...il.com>,
Laurent Pinchart <laurent.pinchart@...asonboard.com>,
Mauro Carvalho Chehab <mchehab@...nel.org>,
Liam Girdwood <lgirdwood@...il.com>,
Mark Brown <broonie@...nel.org>,
Michael Turquette <mturquette@...libre.com>,
Stephen Boyd <sboyd@...nel.org>, Len Brown <lenb@...nel.org>,
ACPI Devel Maling List <linux-acpi@...r.kernel.org>,
Platform Driver <platform-driver-x86@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
linux-i2c <linux-i2c@...r.kernel.org>,
Sakari Ailus <sakari.ailus@...ux.intel.com>,
Kate Hsuan <hpa@...hat.com>,
Linux Media Mailing List <linux-media@...r.kernel.org>,
linux-clk <linux-clk@...r.kernel.org>
Subject: Re: [PATCH v4 08/11] platform/x86: int3472: Add get_sensor_adev_and_name()
helper
On Mon, Nov 1, 2021 at 12:49 PM Hans de Goede <hdegoede@...hat.com> wrote:
> On 11/1/21 11:46, Andy Shevchenko wrote:
> > On Mon, Nov 1, 2021 at 12:44 PM Andy Shevchenko
> > <andy.shevchenko@...il.com> wrote:
...
> > Hmm... But then in the original code and with this proposal the
> > acpi_dev_put() seems a bit strange to me.
> > If we are fine (no error code returned) why would the caller (note
> > _er_) go different paths?
>
> We always need to get the dev to get the name, but some callers are
> only interested in the name, so they pass NULL for sensor_adev_ret,
> this helps to keep the code calling this clean, which is the whole
> idea of having a helper for this.
OK.
(Not that I'm very happy with this, but... the function needs a
comment about this alternative behaviour, I forgot if it already has,
though)
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists