From: Jonathan Cameron <jic23@kernel.org>
To: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Cc: "Nuno Sá" <noname.nuno@gmail.com>,
"Lucas Stankus" <lucas.p.stankus@gmail.com>,
"Lars-Peter Clausen" <lars@metafoo.de>,
"Michael Hennerich" <Michael.Hennerich@analog.com>,
"Puranjay Mohan" <puranjay@kernel.org>,
"Ramona Bolboaca" <ramona.bolboaca@analog.com>,
"Oleksij Rempel" <o.rempel@pengutronix.de>,
kernel@pengutronix.de,
"Cosmin Tanislav" <cosmin.tanislav@analog.com>,
"Marius Cristea" <marius.cristea@microchip.com>,
linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/8] iio: accel: adxl313: simplify with spi_get_device_match_data()
Date: Sat, 8 Jun 2024 18:22:40 +0100 [thread overview]
Message-ID: <20240608182240.1e3a8153@jic23-huawei> (raw)
In-Reply-To: <69e1a5b1-e5ce-4bcc-a0c4-2d02e777c296@linaro.org>
On Fri, 7 Jun 2024 11:18:54 +0200
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> wrote:
> On 07/06/2024 10:57, Nuno Sá wrote:
> > On Thu, 2024-06-06 at 16:26 +0200, Krzysztof Kozlowski wrote:
> >> Use spi_get_device_match_data() helper to simplify a bit the driver.
> >>
> >> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> >> ---
> >> drivers/iio/accel/adxl313_spi.c | 8 +-------
> >> 1 file changed, 1 insertion(+), 7 deletions(-)
> >>
> >> diff --git a/drivers/iio/accel/adxl313_spi.c b/drivers/iio/accel/adxl313_spi.c
> >> index b7cc15678a2b..6f8d73f6e5a9 100644
> >> --- a/drivers/iio/accel/adxl313_spi.c
> >> +++ b/drivers/iio/accel/adxl313_spi.c
> >> @@ -72,13 +72,7 @@ static int adxl313_spi_probe(struct spi_device *spi)
> >> if (ret)
> >> return ret;
> >>
> >> - /*
> >> - * Retrieves device specific data as a pointer to a
> >> - * adxl313_chip_info structure
> >> - */
> >> - chip_data = device_get_match_data(&spi->dev);
> >> - if (!chip_data)
> >> - chip_data = (const struct adxl313_chip_info
> >> *)spi_get_device_id(spi)->driver_data;
> >> + chip_data = spi_get_device_match_data(spi);
> >>
> >
> > I understand you're sticking with the original code but since you're doing this,
> > could we maybe add proper error checking for the call? Maybe Jonathan can even
> > tweak that while applying...
> >
> > (same comment for patch 3)
>
> I consider that a separate patch/work, because it would have functional
> impact.
Agreed. Though error checking on these is normally paranoia / readability thing
as we probed from some firmware match and all those entries are present, so
it should just work.
>
> Best regards,
> Krzysztof
>
next prev parent reply other threads:[~2024-06-08 17:22 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-06 14:26 [PATCH 0/8] iio: simplify with spi_get_device_match_data() Krzysztof Kozlowski
2024-06-06 14:26 ` [PATCH 1/8] iio: accel: adxl313: " Krzysztof Kozlowski
2024-06-07 8:57 ` Nuno Sá
2024-06-07 9:18 ` Krzysztof Kozlowski
2024-06-08 17:22 ` Jonathan Cameron [this message]
2024-06-06 14:26 ` [PATCH 2/8] iio: accel: adxl355: " Krzysztof Kozlowski
2024-06-06 14:26 ` [PATCH 3/8] iio: adc: max11205: " Krzysztof Kozlowski
2024-06-06 14:26 ` [PATCH 4/8] iio: adc: ti-ads131e08: " Krzysztof Kozlowski
2024-06-06 14:26 ` [PATCH 5/8] iio: adc: ti-tsc2046: " Krzysztof Kozlowski
2024-06-06 14:26 ` [PATCH 6/8] iio: addac: ad74413r: " Krzysztof Kozlowski
2024-06-06 14:26 ` [PATCH 7/8] iio: dac: max5522: " Krzysztof Kozlowski
2024-06-06 14:26 ` [PATCH 8/8] iio: adc: mcp3564: drop redundant open-coded spi_get_device_match_data() Krzysztof Kozlowski
2024-06-07 8:55 ` [PATCH 0/8] iio: simplify with spi_get_device_match_data() Nuno Sá
2024-06-08 17:25 ` Jonathan Cameron
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240608182240.1e3a8153@jic23-huawei \
--to=jic23@kernel.org \
--cc=Michael.Hennerich@analog.com \
--cc=cosmin.tanislav@analog.com \
--cc=kernel@pengutronix.de \
--cc=krzysztof.kozlowski@linaro.org \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lucas.p.stankus@gmail.com \
--cc=marius.cristea@microchip.com \
--cc=noname.nuno@gmail.com \
--cc=o.rempel@pengutronix.de \
--cc=puranjay@kernel.org \
--cc=ramona.bolboaca@analog.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox