[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID:
<FR3P281MB1757EB72B134982F58BA23F7CEB72@FR3P281MB1757.DEUP281.PROD.OUTLOOK.COM>
Date: Thu, 10 Apr 2025 09:32:21 +0000
From: Jean-Baptiste Maneyrol <Jean-Baptiste.Maneyrol@....com>
To: Andy Shevchenko <andy@...nel.org>
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"
<linux-iio@...r.kernel.org>,
"devicetree@...r.kernel.org"
<devicetree@...r.kernel.org>,
"linux-kernel@...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
Hello Andy,
I tried to respond inline, but my apologies it is not working well with the email client I'm obliged to use.
To sum-up, property.h is already included and I will simplify the fwnode usage to use the API calls directly.
I will just keep the over 80 limit following Jonathan recommendations.
Thanks,
JB
________________________________________
From: Andy Shevchenko <andy@...nel.org>
Sent: Wednesday, April 9, 2025 19:07
To: Jean-Baptiste Maneyrol <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 <linux-iio@...r.kernel.org>; devicetree@...r.kernel.org <devicetree@...r.kernel.org>; linux-kernel@...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
This Message Is From an External Sender
This message came from outside your organization.
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?
property.h is already included.
...
> + /* 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,
OK, I will simplify and user directly the fwnode functions.
> + 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