* [PATCH] phy: phy-can-transceiver: Make devm_gpiod_get optional
@ 2021-11-02 11:21 ` Aswath Govindraju
0 siblings, 0 replies; 6+ messages in thread
From: Aswath Govindraju @ 2021-11-02 11:21 UTC (permalink / raw)
Cc: Nishanth Menon, Aswath Govindraju, Wolfgang Grandegger,
Marc Kleine-Budde, Kishon Vijay Abraham I, Vinod Koul, linux-can,
linux-phy, linux-kernel
In some cases the standby/enable gpio can be pulled low/high and would not
be connected to a gpio. The current driver implementation will return an
error in these cases. Therefore, make devm_gpiod_get optional.
Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
---
drivers/phy/phy-can-transceiver.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/phy/phy-can-transceiver.c b/drivers/phy/phy-can-transceiver.c
index c2cb93b4df71..6f3fe37dee0e 100644
--- a/drivers/phy/phy-can-transceiver.c
+++ b/drivers/phy/phy-can-transceiver.c
@@ -110,14 +110,14 @@ static int can_transceiver_phy_probe(struct platform_device *pdev)
can_transceiver_phy->generic_phy = phy;
if (drvdata->flags & CAN_TRANSCEIVER_STB_PRESENT) {
- standby_gpio = devm_gpiod_get(dev, "standby", GPIOD_OUT_HIGH);
+ standby_gpio = devm_gpiod_get_optional(dev, "standby", GPIOD_OUT_HIGH);
if (IS_ERR(standby_gpio))
return PTR_ERR(standby_gpio);
can_transceiver_phy->standby_gpio = standby_gpio;
}
if (drvdata->flags & CAN_TRANSCEIVER_EN_PRESENT) {
- enable_gpio = devm_gpiod_get(dev, "enable", GPIOD_OUT_LOW);
+ enable_gpio = devm_gpiod_get_optional(dev, "enable", GPIOD_OUT_LOW);
if (IS_ERR(enable_gpio))
return PTR_ERR(enable_gpio);
can_transceiver_phy->enable_gpio = enable_gpio;
--
2.17.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH] phy: phy-can-transceiver: Make devm_gpiod_get optional
@ 2021-11-02 11:21 ` Aswath Govindraju
0 siblings, 0 replies; 6+ messages in thread
From: Aswath Govindraju @ 2021-11-02 11:21 UTC (permalink / raw)
Cc: Nishanth Menon, Aswath Govindraju, Wolfgang Grandegger,
Marc Kleine-Budde, Kishon Vijay Abraham I, Vinod Koul, linux-can,
linux-phy, linux-kernel
In some cases the standby/enable gpio can be pulled low/high and would not
be connected to a gpio. The current driver implementation will return an
error in these cases. Therefore, make devm_gpiod_get optional.
Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
---
drivers/phy/phy-can-transceiver.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/phy/phy-can-transceiver.c b/drivers/phy/phy-can-transceiver.c
index c2cb93b4df71..6f3fe37dee0e 100644
--- a/drivers/phy/phy-can-transceiver.c
+++ b/drivers/phy/phy-can-transceiver.c
@@ -110,14 +110,14 @@ static int can_transceiver_phy_probe(struct platform_device *pdev)
can_transceiver_phy->generic_phy = phy;
if (drvdata->flags & CAN_TRANSCEIVER_STB_PRESENT) {
- standby_gpio = devm_gpiod_get(dev, "standby", GPIOD_OUT_HIGH);
+ standby_gpio = devm_gpiod_get_optional(dev, "standby", GPIOD_OUT_HIGH);
if (IS_ERR(standby_gpio))
return PTR_ERR(standby_gpio);
can_transceiver_phy->standby_gpio = standby_gpio;
}
if (drvdata->flags & CAN_TRANSCEIVER_EN_PRESENT) {
- enable_gpio = devm_gpiod_get(dev, "enable", GPIOD_OUT_LOW);
+ enable_gpio = devm_gpiod_get_optional(dev, "enable", GPIOD_OUT_LOW);
if (IS_ERR(enable_gpio))
return PTR_ERR(enable_gpio);
can_transceiver_phy->enable_gpio = enable_gpio;
--
2.17.1
--
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] phy: phy-can-transceiver: Make devm_gpiod_get optional
2021-11-02 11:21 ` Aswath Govindraju
@ 2021-11-06 15:12 ` Marc Kleine-Budde
-1 siblings, 0 replies; 6+ messages in thread
From: Marc Kleine-Budde @ 2021-11-06 15:12 UTC (permalink / raw)
To: Aswath Govindraju
Cc: Nishanth Menon, Wolfgang Grandegger, Kishon Vijay Abraham I,
Vinod Koul, linux-can, linux-phy, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 673 bytes --]
On 02.11.2021 16:51:20, Aswath Govindraju wrote:
> In some cases the standby/enable gpio can be pulled low/high and would not
> be connected to a gpio. The current driver implementation will return an
> error in these cases. Therefore, make devm_gpiod_get optional.
>
> Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
Acked-by: Marc Kleine-Budde <mkl@pengutronix.de>
regards,
Marc
--
Pengutronix e.K. | Marc Kleine-Budde |
Embedded Linux | https://www.pengutronix.de |
Vertretung West/Dortmund | Phone: +49-231-2826-924 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] phy: phy-can-transceiver: Make devm_gpiod_get optional
@ 2021-11-06 15:12 ` Marc Kleine-Budde
0 siblings, 0 replies; 6+ messages in thread
From: Marc Kleine-Budde @ 2021-11-06 15:12 UTC (permalink / raw)
To: Aswath Govindraju
Cc: Nishanth Menon, Wolfgang Grandegger, Kishon Vijay Abraham I,
Vinod Koul, linux-can, linux-phy, linux-kernel
[-- Attachment #1.1: Type: text/plain, Size: 673 bytes --]
On 02.11.2021 16:51:20, Aswath Govindraju wrote:
> In some cases the standby/enable gpio can be pulled low/high and would not
> be connected to a gpio. The current driver implementation will return an
> error in these cases. Therefore, make devm_gpiod_get optional.
>
> Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
Acked-by: Marc Kleine-Budde <mkl@pengutronix.de>
regards,
Marc
--
Pengutronix e.K. | Marc Kleine-Budde |
Embedded Linux | https://www.pengutronix.de |
Vertretung West/Dortmund | Phone: +49-231-2826-924 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
[-- Attachment #2: Type: text/plain, Size: 112 bytes --]
--
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] phy: phy-can-transceiver: Make devm_gpiod_get optional
2021-11-02 11:21 ` Aswath Govindraju
@ 2021-11-23 6:45 ` Vinod Koul
-1 siblings, 0 replies; 6+ messages in thread
From: Vinod Koul @ 2021-11-23 6:45 UTC (permalink / raw)
To: Aswath Govindraju
Cc: Nishanth Menon, Wolfgang Grandegger, Marc Kleine-Budde,
Kishon Vijay Abraham I, linux-can, linux-phy, linux-kernel
On 02-11-21, 16:51, Aswath Govindraju wrote:
> In some cases the standby/enable gpio can be pulled low/high and would not
> be connected to a gpio. The current driver implementation will return an
> error in these cases. Therefore, make devm_gpiod_get optional.
Applied, thanks
--
~Vinod
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] phy: phy-can-transceiver: Make devm_gpiod_get optional
@ 2021-11-23 6:45 ` Vinod Koul
0 siblings, 0 replies; 6+ messages in thread
From: Vinod Koul @ 2021-11-23 6:45 UTC (permalink / raw)
To: Aswath Govindraju
Cc: Nishanth Menon, Wolfgang Grandegger, Marc Kleine-Budde,
Kishon Vijay Abraham I, linux-can, linux-phy, linux-kernel
On 02-11-21, 16:51, Aswath Govindraju wrote:
> In some cases the standby/enable gpio can be pulled low/high and would not
> be connected to a gpio. The current driver implementation will return an
> error in these cases. Therefore, make devm_gpiod_get optional.
Applied, thanks
--
~Vinod
--
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2021-11-23 6:45 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-02 11:21 [PATCH] phy: phy-can-transceiver: Make devm_gpiod_get optional Aswath Govindraju
2021-11-02 11:21 ` Aswath Govindraju
2021-11-06 15:12 ` Marc Kleine-Budde
2021-11-06 15:12 ` Marc Kleine-Budde
2021-11-23 6:45 ` Vinod Koul
2021-11-23 6:45 ` Vinod Koul
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.