diff mbox series

[v2,2/3] serial: sh-sci: Remove check for specific mctrl_gpio_init() return value

Message ID 20190801184505.17239-2-frieder.schrempf@kontron.de (mailing list archive)
State New, archived
Headers show
Series [v2,1/3] serial: mctrl_gpio: Avoid probe failures in case of missing gpiolib | expand

Commit Message

Frieder Schrempf Aug. 1, 2019, 6:45 p.m. UTC
From: Frieder Schrempf <frieder.schrempf@kontron.de>

Now that the mctrl_gpio code returns NULL instead of ERR_PTR(-ENOSYS)
in cases when CONFIG_GPIOLIB is disabled, we can safely remove this
check.

Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
---
 drivers/tty/serial/sh-sci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Uwe Kleine-König Aug. 1, 2019, 8:39 p.m. UTC | #1
On Thu, Aug 01, 2019 at 06:45:24PM +0000, Schrempf Frieder wrote:
> From: Frieder Schrempf <frieder.schrempf@kontron.de>
> 
> Now that the mctrl_gpio code returns NULL instead of ERR_PTR(-ENOSYS)
> in cases when CONFIG_GPIOLIB is disabled, we can safely remove this
> check.

I would mention -ENOSYS in the Subject line. Something like:

	serial: sh-sci: don't check for mctrl_gpio_init returning -ENOSYS

	Now that the mctrl_gpio code returns NULL instead of
	ERR_PTR(-ENOSYS) if CONFIG_GPIOLIB is disabled, we can safely
	remove this check.

Thanks
Uwe
Frieder Schrempf Aug. 2, 2019, 7:59 a.m. UTC | #2
On 01.08.19 22:39, Uwe Kleine-König wrote:
> On Thu, Aug 01, 2019 at 06:45:24PM +0000, Schrempf Frieder wrote:
>> From: Frieder Schrempf <frieder.schrempf@kontron.de>
>>
>> Now that the mctrl_gpio code returns NULL instead of ERR_PTR(-ENOSYS)
>> in cases when CONFIG_GPIOLIB is disabled, we can safely remove this
>> check.
> 
> I would mention -ENOSYS in the Subject line. Something like:
> 
> 	serial: sh-sci: don't check for mctrl_gpio_init returning -ENOSYS
> 
> 	Now that the mctrl_gpio code returns NULL instead of
> 	ERR_PTR(-ENOSYS) if CONFIG_GPIOLIB is disabled, we can safely
> 	remove this check.

Indeed, I failed to come up with a better subject line. I will adopt 
your proposal.

> Thanks
> Uwe
>
diff mbox series

Patch

diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
index d18c680aa64b..249325b65ee0 100644
--- a/drivers/tty/serial/sh-sci.c
+++ b/drivers/tty/serial/sh-sci.c
@@ -3287,7 +3287,7 @@  static int sci_probe_single(struct platform_device *dev,
 		return ret;
 
 	sciport->gpios = mctrl_gpio_init(&sciport->port, 0);
-	if (IS_ERR(sciport->gpios) && PTR_ERR(sciport->gpios) != -ENOSYS)
+	if (IS_ERR(sciport->gpios))
 		return PTR_ERR(sciport->gpios);
 
 	if (sciport->has_rtscts) {