From: Andy Shevchenko <andy@kernel.org>
To: jean-baptiste.maneyrol@tdk.com
Cc: "Jonathan Cameron" <jic23@kernel.org>,
"Lars-Peter Clausen" <lars@metafoo.de>,
"Rob Herring" <robh@kernel.org>,
"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
"Conor Dooley" <conor+dt@kernel.org>,
"David Lechner" <dlechner@baylibre.com>,
"Nuno Sá" <nuno.sa@analog.com>,
linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 2/2] iio: imu: inv_icm42600: switch to use generic name irq get
Date: Wed, 9 Apr 2025 20:07:43 +0300 [thread overview]
Message-ID: <Z_apXw_HoD0EHHY-@smile.fi.intel.com> (raw)
In-Reply-To: <20250409-iio-imu-inv-icm42600-rework-interrupt-using-names-v3-2-dab85a0a7c2b@tdk.com>
On Wed, Apr 09, 2025 at 05:14:32PM +0200, Jean-Baptiste Maneyrol via B4 Relay wrote:
> From: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com>
>
> Use generic fwnode_irq_get_byname() for getting interrupt pin using
> interrupt name. Only INT1 is supported by the driver currently.
>
> If not found fallback to first defined interrupt to keep compatibility.
...
> -int inv_icm42600_core_probe(struct regmap *regmap, int chip, int irq,
> +int inv_icm42600_core_probe(struct regmap *regmap, int chip,
> inv_icm42600_bus_setup bus_setup);
If you use 100 limit, it fits now on one line.
...
> -int inv_icm42600_core_probe(struct regmap *regmap, int chip, int irq,
> +int inv_icm42600_core_probe(struct regmap *regmap, int chip,
> inv_icm42600_bus_setup bus_setup)
Ditto.
...
> + struct fwnode_handle *fwnode;
Do you need to include property.h?
...
> + /* get INT1 only supported interrupt or fallback to first interrupt */
> + fwnode = dev_fwnode(dev);
> + if (!fwnode)
> + return -ENODEV;
Unneeded check, the below will do it for you,
> + irq = fwnode_irq_get_byname(fwnode, "INT1");
> + if (irq < 0 && irq != -EPROBE_DEFER) {
> + dev_info(dev, "no INT1 interrupt defined, fallback to first interrupt\n");
> + irq = fwnode_irq_get(fwnode, 0);
> + }
> + if (irq < 0)
> + return dev_err_probe(dev, irq, "error missing INT1 interrupt\n");
...
> - return inv_icm42600_core_probe(regmap, chip, client->irq,
> + return inv_icm42600_core_probe(regmap, chip,
> inv_icm42600_i2c_bus_setup);
This is now one line (81 characters which is fine independently on your choice
of the limit).
...
> - return inv_icm42600_core_probe(regmap, chip, spi->irq,
> + return inv_icm42600_core_probe(regmap, chip,
> inv_icm42600_spi_bus_setup);
One line.
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2025-04-09 17:07 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-09 15:14 [PATCH v3 0/2] iio: imu: inv_icm42600: switch to use generic name irq get Jean-Baptiste Maneyrol via B4 Relay
2025-04-09 15:14 ` [PATCH v3 1/2] dt-bindings: iio: imu: icm42600: add interrupt naming support Jean-Baptiste Maneyrol via B4 Relay
2025-04-10 6:58 ` Krzysztof Kozlowski
2025-04-09 15:14 ` [PATCH v3 2/2] iio: imu: inv_icm42600: switch to use generic name irq get Jean-Baptiste Maneyrol via B4 Relay
2025-04-09 17:07 ` Andy Shevchenko [this message]
2025-04-09 17:12 ` Jonathan Cameron
2025-04-10 9:32 ` Jean-Baptiste Maneyrol
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=Z_apXw_HoD0EHHY-@smile.fi.intel.com \
--to=andy@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dlechner@baylibre.com \
--cc=jean-baptiste.maneyrol@tdk.com \
--cc=jic23@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nuno.sa@analog.com \
--cc=robh@kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).