mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <sha@pengutronix.de>
To: "Daniel Brát" <danek.brat@gmail.com>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH] phy: core: Make 'phy_optional_get' return NULL when not implemented
Date: Thu, 3 Mar 2022 10:53:45 +0100	[thread overview]
Message-ID: <20220303095345.GA5348@pengutronix.de> (raw)
In-Reply-To: <20211020083954.3787-1-danek.brat@gmail.com>

On Wed, Oct 20, 2021 at 10:39:54AM +0200, Daniel Brát wrote:
> Make 'phy_optional_get' return NULL instead of ERR_PTR(-ENOSYS) when the
> CONFIG_GENERIC_PHY is not enabled. It makes more sense to return NULL instead
> of straight up throwing a error since the function has 'optional' in its name.
> This also fixes dwc2 usb driver which would previously fail inside its probe
> function despite being able to function without a phy just fine.
> 
> Signed-off-by: Daniel Brát <danek.brat@gmail.com>
> ---
>  include/linux/phy/phy.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

After I have received a patch which lets the EHCI driver depend on
CONFIG_GENERIC_PHY which effectively disables the EHCI in a bunch of
defconfigs I finally deciced to take this patch as-is.

Sascha

> 
> diff --git a/include/linux/phy/phy.h b/include/linux/phy/phy.h
> index 679ce6e42..321e546f9 100644
> --- a/include/linux/phy/phy.h
> +++ b/include/linux/phy/phy.h
> @@ -195,7 +195,7 @@ static inline struct phy *phy_get(struct device_d *dev, const char *string)
>  static inline struct phy *phy_optional_get(struct device_d *dev,
>  					   const char *string)
>  {
> -	return ERR_PTR(-ENOSYS);
> +	return NULL;
>  }
>  
>  static inline struct phy *of_phy_get_by_phandle(struct device_d *dev,
> -- 
> 2.17.1
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


      parent reply	other threads:[~2022-03-03  9:55 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-20  8:39 Daniel Brát
2021-11-01  9:00 ` Sascha Hauer
     [not found]   ` <CAMHeXxMJYC2q4Hs7zd9A=5-KsXyFUtTshMVoZZC2nJUah=LtjA@mail.gmail.com>
2021-11-01 19:04     ` Trent Piepho
2021-11-02  7:40     ` Sascha Hauer
2021-11-03 22:35       ` Trent Piepho
2021-11-04 20:02         ` Sascha Hauer
2021-11-04 21:40           ` Trent Piepho
2021-11-08  9:10             ` Sascha Hauer
2021-11-08 22:01               ` Trent Piepho
2021-11-11 13:09                 ` Sascha Hauer
2022-03-03  9:53 ` Sascha Hauer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220303095345.GA5348@pengutronix.de \
    --to=sha@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=danek.brat@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox