All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] phy: Return NULL if the PHY is optional (part two)
@ 2023-01-18 10:02 ` Geert Uytterhoeven
  0 siblings, 0 replies; 4+ messages in thread
From: Geert Uytterhoeven @ 2023-01-18 10:02 UTC (permalink / raw)
  To: Vinod Koul, Kishon Vijay Abraham I
  Cc: Maxime Ripard, Andrew Lunn, linux-phy, linux-kernel, Geert Uytterhoeven

If we're trying to get a handle to an optional PHY, then the PHY
framework being disabled shouldn't return a hard error.

Instead, return NULL just like phy_optional_get() does when there's no
PHY provided in the DT.

Based on commit 11a6e41c0ee503ff ("phy: Return NULL if the phy is
optional"), which did the same thing for devm_phy_optional_get().

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
It seems there were never any in-tree users of this function since its
introduction in 788a4d56ff378bff ("drivers: phy: Add support for
optional phys") in v3.14.
Perhaps it should be removed?
---
 include/linux/phy/phy.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/phy/phy.h b/include/linux/phy/phy.h
index b1413757fcc3b89b..559c3da515073697 100644
--- a/include/linux/phy/phy.h
+++ b/include/linux/phy/phy.h
@@ -429,7 +429,7 @@ static inline struct phy *phy_get(struct device *dev, const char *string)
 static inline struct phy *phy_optional_get(struct device *dev,
 					   const char *string)
 {
-	return ERR_PTR(-ENOSYS);
+	return NULL;
 }
 
 static inline struct phy *devm_phy_get(struct device *dev, const char *string)
-- 
2.34.1


-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH] phy: Return NULL if the PHY is optional (part two)
@ 2023-01-18 10:02 ` Geert Uytterhoeven
  0 siblings, 0 replies; 4+ messages in thread
From: Geert Uytterhoeven @ 2023-01-18 10:02 UTC (permalink / raw)
  To: Vinod Koul, Kishon Vijay Abraham I
  Cc: Maxime Ripard, Andrew Lunn, linux-phy, linux-kernel, Geert Uytterhoeven

If we're trying to get a handle to an optional PHY, then the PHY
framework being disabled shouldn't return a hard error.

Instead, return NULL just like phy_optional_get() does when there's no
PHY provided in the DT.

Based on commit 11a6e41c0ee503ff ("phy: Return NULL if the phy is
optional"), which did the same thing for devm_phy_optional_get().

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
It seems there were never any in-tree users of this function since its
introduction in 788a4d56ff378bff ("drivers: phy: Add support for
optional phys") in v3.14.
Perhaps it should be removed?
---
 include/linux/phy/phy.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/phy/phy.h b/include/linux/phy/phy.h
index b1413757fcc3b89b..559c3da515073697 100644
--- a/include/linux/phy/phy.h
+++ b/include/linux/phy/phy.h
@@ -429,7 +429,7 @@ static inline struct phy *phy_get(struct device *dev, const char *string)
 static inline struct phy *phy_optional_get(struct device *dev,
 					   const char *string)
 {
-	return ERR_PTR(-ENOSYS);
+	return NULL;
 }
 
 static inline struct phy *devm_phy_get(struct device *dev, const char *string)
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] phy: Return NULL if the PHY is optional (part two)
  2023-01-18 10:02 ` Geert Uytterhoeven
@ 2023-01-20  7:11   ` Vinod Koul
  -1 siblings, 0 replies; 4+ messages in thread
From: Vinod Koul @ 2023-01-20  7:11 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Kishon Vijay Abraham I, Maxime Ripard, Andrew Lunn, linux-phy,
	linux-kernel

On 18-01-23, 11:02, Geert Uytterhoeven wrote:
> If we're trying to get a handle to an optional PHY, then the PHY
> framework being disabled shouldn't return a hard error.
> 
> Instead, return NULL just like phy_optional_get() does when there's no
> PHY provided in the DT.
> 
> Based on commit 11a6e41c0ee503ff ("phy: Return NULL if the phy is
> optional"), which did the same thing for devm_phy_optional_get().
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> ---
> It seems there were never any in-tree users of this function since its
> introduction in 788a4d56ff378bff ("drivers: phy: Add support for
> optional phys") in v3.14.
> Perhaps it should be removed?

Ack, devm_phy_optional_get() is used by bunch of folks, but not this
one, so lets retire this

> ---
>  include/linux/phy/phy.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/linux/phy/phy.h b/include/linux/phy/phy.h
> index b1413757fcc3b89b..559c3da515073697 100644
> --- a/include/linux/phy/phy.h
> +++ b/include/linux/phy/phy.h
> @@ -429,7 +429,7 @@ static inline struct phy *phy_get(struct device *dev, const char *string)
>  static inline struct phy *phy_optional_get(struct device *dev,
>  					   const char *string)
>  {
> -	return ERR_PTR(-ENOSYS);
> +	return NULL;
>  }
>  
>  static inline struct phy *devm_phy_get(struct device *dev, const char *string)
> -- 
> 2.34.1

-- 
~Vinod

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] phy: Return NULL if the PHY is optional (part two)
@ 2023-01-20  7:11   ` Vinod Koul
  0 siblings, 0 replies; 4+ messages in thread
From: Vinod Koul @ 2023-01-20  7:11 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Kishon Vijay Abraham I, Maxime Ripard, Andrew Lunn, linux-phy,
	linux-kernel

On 18-01-23, 11:02, Geert Uytterhoeven wrote:
> If we're trying to get a handle to an optional PHY, then the PHY
> framework being disabled shouldn't return a hard error.
> 
> Instead, return NULL just like phy_optional_get() does when there's no
> PHY provided in the DT.
> 
> Based on commit 11a6e41c0ee503ff ("phy: Return NULL if the phy is
> optional"), which did the same thing for devm_phy_optional_get().
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> ---
> It seems there were never any in-tree users of this function since its
> introduction in 788a4d56ff378bff ("drivers: phy: Add support for
> optional phys") in v3.14.
> Perhaps it should be removed?

Ack, devm_phy_optional_get() is used by bunch of folks, but not this
one, so lets retire this

> ---
>  include/linux/phy/phy.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/linux/phy/phy.h b/include/linux/phy/phy.h
> index b1413757fcc3b89b..559c3da515073697 100644
> --- a/include/linux/phy/phy.h
> +++ b/include/linux/phy/phy.h
> @@ -429,7 +429,7 @@ static inline struct phy *phy_get(struct device *dev, const char *string)
>  static inline struct phy *phy_optional_get(struct device *dev,
>  					   const char *string)
>  {
> -	return ERR_PTR(-ENOSYS);
> +	return NULL;
>  }
>  
>  static inline struct phy *devm_phy_get(struct device *dev, const char *string)
> -- 
> 2.34.1

-- 
~Vinod

-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-01-20  7:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-18 10:02 [PATCH] phy: Return NULL if the PHY is optional (part two) Geert Uytterhoeven
2023-01-18 10:02 ` Geert Uytterhoeven
2023-01-20  7:11 ` Vinod Koul
2023-01-20  7:11   ` 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.