[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170201183440.yxbei7dg776q4fjj@sirena.org.uk>
Date: Wed, 1 Feb 2017 18:34:40 +0000
From: Mark Brown <broonie@...nel.org>
To: Dan O'Donovan <dan@...tex.com>
Cc: linux-acpi@...r.kernel.org,
Andy Shevchenko <andy.shevchenko@...il.com>,
"Rafael J . Wysocki" <rjw@...ysocki.net>,
Jarkko Nikula <jarkko.nikula@...el.com>,
Mika Westerberg <mika.westerberg@...ux.intel.com>,
Len Brown <lenb@...nel.org>, linux-i2c@...r.kernel.org,
Wolfram Sang <wsa@...-dreams.de>, linux-spi@...r.kernel.org,
linux-kernel@...r.kernel.org,
Crestez Dan Leonard <leonard.crestez@...el.com>
Subject: Re: [PATCH v4 3/3] spi: acpi: Initialize modalias from of_compatible
On Fri, Jan 27, 2017 at 01:30:15PM +0000, Dan O'Donovan wrote:
> + if (acpi_of_modalias(adev, spi->modalias, sizeof(spi->modalias)))
> + strlcpy(spi->modalias, acpi_device_hid(adev),
> + sizeof(spi->modalias));
I can't help but think that this would be simpler to use if the
interface were something like acpi_set_modalias() and it did the
fallback to the ACPI HID internally. It'd both avoid a small amount of
code duplication and make the code read a bit more naturally - I have to
think to realise that this means "if there isn't an OF name use the
HID" since it looks like a boolean function. Then again just putting a
!= 0 in the test would have the same effect probably.
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists