From mboxrd@z Thu Jan 1 00:00:00 1970 From: Maxime Ripard Subject: Re: [PATCH 02/10] phy: Add configuration interface Date: Fri, 7 Sep 2018 11:01:29 +0200 Message-ID: <20180907090129.yg5m5h7ocoow5xbv@flea> References: <8397722.XVQDA25ZU6@avalon> <20180906144807.pn753tgfyovvheil@flea> <20180906162450.GA26997@lunn.ch> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0972778860==" Return-path: Received: from mail.bootlin.com (mail.bootlin.com [62.4.15.54]) by gabe.freedesktop.org (Postfix) with ESMTP id 3EEEA6E862 for ; Fri, 7 Sep 2018 09:01:40 +0000 (UTC) In-Reply-To: <20180906162450.GA26997@lunn.ch> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: Andrew Lunn Cc: Rafal Ciepiela , Boris Brezillon , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Kishon Vijay Abraham I , Krzysztof Witos , Chen-Yu Tsai , Laurent Pinchart , Thomas Petazzoni , linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org List-Id: dri-devel@lists.freedesktop.org --===============0972778860== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="3efarss5q7c4qdy6" Content-Disposition: inline --3efarss5q7c4qdy6 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Sep 06, 2018 at 06:24:50PM +0200, Andrew Lunn wrote: > > > > +int phy_configure(struct phy *phy, enum phy_mode mode, > > > > + union phy_configure_opts *opts) > > > > +{ > > > > + int ret; > > > > + > > > > + if (!phy) > > > > + return -EINVAL; > > > > + > > > > + if (!phy->ops->configure) > > > > + return 0; > > >=20 > > > Shouldn't you report an error to the caller ? If a caller expects the= PHY to=20 > > > be configurable, I would assume that silently ignoring the requested= =20 > > > configuration won't work great. > >=20 > > I'm not sure. I also expect a device having to interact with multiple > > PHYs, some of them needing some configuration while some other do > > not. In that scenario, returning 0 seems to be the right thing to do. >=20 > You could return -EOPNOTSUPP. That is common in the network stack. The > caller then has the information to decide if it should keep going, or > return an error. Ok, that works for me then. Maxime --=20 Maxime Ripard, Bootlin Embedded Linux and Kernel engineering https://bootlin.com --3efarss5q7c4qdy6 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEE0VqZU19dR2zEVaqr0rTAlCFNr3QFAluSPmgACgkQ0rTAlCFN r3SiCA//esrZwoTzf8uzPwocw6DIoDgAujUydvkWg7qNajUtjsAvyts+hsYpYV8C Dgn3S8EbeJ4WNv1G5R+jJJh3WfqmQhWMWB9N3ibVdI9EIO3W1Kw9nkVr/iXXn6Rs wop44tjmo9L4yZwwylUapQZklVuIcHx62cIxFBdeeKuTdt4oa8OCNP0yTR4HS4g4 WDX3WZccwp/vU9ZpgMYng2hAcmjAXEiYfsqrAd74R7gI8op44cz1ziWQLSaNGsut /z+7VfrCN54fQFwFqZojPuIW6yuAU2wo7hE+rTS20vVCdJtBEs0OpwPhWQ0LMBk4 qQZLue46W56LFdPkSEYDkFYY5zkxIBJqBQUjz6SdcYEQsn7Jrp92KJf1+FI5ilH/ vYkAYUIYHjQOPF4kltvFQx9JkeUa7CSeVqix2qF09ZYOpxAVcuNuRQnu9ia/i8kU PX+89tf0m5uS0++2orSJLtd+EMMmH/u71X4r4AhNdmkBw9iYzs2i7axzjvoPcVup f9l9fc0N3iCbYjACSSFt+2cOVQ6sRiDr5XQe+YmKgHwJXUd0lYtudXovTrA5TVAp jWYOl60hs0RIBEt2OU5rgVCFRLtItaUQ7BLg1l/L+8V6bv7d/nKejb+uWrmqqZ+5 AvnjVcSZv4hey+4XM49HL8Mcnif251tTIrg2UKK6oK/W5opasbw= =1fsx -----END PGP SIGNATURE----- --3efarss5q7c4qdy6-- --===============0972778860== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KZHJpLWRldmVs IG1haWxpbmcgbGlzdApkcmktZGV2ZWxAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vZHJpLWRldmVsCg== --===============0972778860==--