diff mbox series

[v1,1/1] gpiolib-acpi: Drop unneeded ERR_CAST() in __acpi_find_gpio()

Message ID 20250304143119.1816463-1-andriy.shevchenko@linux.intel.com (mailing list archive)
State Handled Elsewhere, archived
Headers show
Series [v1,1/1] gpiolib-acpi: Drop unneeded ERR_CAST() in __acpi_find_gpio() | expand

Commit Message

Andy Shevchenko March 4, 2025, 2:31 p.m. UTC
The checked type by PTR_ERR() is the same as returned by __acpi_find_gpio().
Hence there is no need to cast, drop it.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/gpio/gpiolib-acpi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Mika Westerberg March 4, 2025, 2:36 p.m. UTC | #1
On Tue, Mar 04, 2025 at 04:31:19PM +0200, Andy Shevchenko wrote:
> The checked type by PTR_ERR() is the same as returned by __acpi_find_gpio().
> Hence there is no need to cast, drop it.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Acked-by: Mika Westerberg <westeri@kernel.org>
Andy Shevchenko March 4, 2025, 2:48 p.m. UTC | #2
On Tue, Mar 04, 2025 at 04:36:48PM +0200, Mika Westerberg wrote:
> On Tue, Mar 04, 2025 at 04:31:19PM +0200, Andy Shevchenko wrote:
> > The checked type by PTR_ERR() is the same as returned by __acpi_find_gpio().
> > Hence there is no need to cast, drop it.
> > 
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> 
> Acked-by: Mika Westerberg <westeri@kernel.org>

Pushed to my review and testing queue, thanks!
diff mbox series

Patch

diff --git a/drivers/gpio/gpiolib-acpi.c b/drivers/gpio/gpiolib-acpi.c
index 2aa88ace5868..90db393377fc 100644
--- a/drivers/gpio/gpiolib-acpi.c
+++ b/drivers/gpio/gpiolib-acpi.c
@@ -993,7 +993,7 @@  __acpi_find_gpio(struct fwnode_handle *fwnode, const char *con_id, unsigned int
 			desc = acpi_get_gpiod_from_data(fwnode,
 							propname, idx, info);
 		if (PTR_ERR(desc) == -EPROBE_DEFER)
-			return ERR_CAST(desc);
+			return (desc);
 
 		if (!IS_ERR(desc))
 			return desc;