[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z_apXw_HoD0EHHY-@smile.fi.intel.com>
Date: Wed, 9 Apr 2025 20:07:43 +0300
From: Andy Shevchenko <andy@...nel.org>
To: jean-baptiste.maneyrol@....com
Cc: Jonathan Cameron <jic23@...nel.org>,
Lars-Peter Clausen <lars@...afoo.de>, Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>,
David Lechner <dlechner@...libre.com>,
Nuno Sá <nuno.sa@...log.com>,
linux-iio@...r.kernel.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 2/2] iio: imu: inv_icm42600: switch to use generic
name irq get
On Wed, Apr 09, 2025 at 05:14:32PM +0200, Jean-Baptiste Maneyrol via B4 Relay wrote:
> From: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@....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
Powered by blists - more mailing lists