Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1545899imm; Fri, 7 Sep 2018 02:03:03 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbqCkmB3rpI1L3eyPbOFETX5LyMYPLhPsCU5NU4hDaM0oVQGl1odkBEx0oHFi/cfNox0H1E X-Received: by 2002:a62:1bc2:: with SMTP id b185-v6mr7478736pfb.170.1536310983324; Fri, 07 Sep 2018 02:03:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536310983; cv=none; d=google.com; s=arc-20160816; b=bbUQqYA7dt0yJs28l0oHKrHwZT0tPwT+obJI7zPjqntanjdWwtlkTG6pf52Qdqii9N ybPcEfjPu83AbxI2/Q8pCNwgqRv0Rv/iYvq5TkqJZ6xy+Gu+MEtbuypjKYlClo47Qp7+ YvYVzy6tgJhSobE+cq/beoUPf4wAXYjrTNJHATF9n47qf2WPOnuJ6V8YFt0rt92EuVr7 icm9HZCL2NPCpAF3ohtuuBMMPW9AYdhmUWykmlPiQ3l6yepYTeqvtAtEhp7c6yE7OVa/ puCAYf+Z1ZMDX96xopNYdtQshBt1dRkIEIF1uZAteQGdS/J8k7ygEWB+YHvDtiw4IYl3 CoZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=mighoBRnW74urQSKlrnNExBSKXkxtJkNqxu/6DOiRz8=; b=PV1+GQWS0qcsLA6PcrUPNqIAJSmvALBVxQEuYViCikB0a6ktSMZcYR6PdcSeDI4TOk XqweE5zK2kNAfjNtrQ7Ia0kT1I4zmp9n3JNQkgYDMzbe+fm3RQ63dg/LNVsLT7z1btMO En84IVk0jm7BgxSqmVJTzCatZz80ydD+nRMpniEFmm/zO+bZyi0HmSxPWuBSwFfqOiqh /82H7U+qdKY48dxa0LVdrs37FWf7Q6rQarlLKwc9yT/vk/CYUuD4ioGc8k5cVLhcRjrl 7h/gYuaWsPcAw9MmpGbz6p5XH5RNIbaXqtoKZGfcBmaSkiEWDgkXyu5+AyuAkknG7mrd ZQcw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x189-v6si7616544pgd.1.2018.09.07.02.02.47; Fri, 07 Sep 2018 02:03:03 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728098AbeIGNlk (ORCPT + 99 others); Fri, 7 Sep 2018 09:41:40 -0400 Received: from mail.bootlin.com ([62.4.15.54]:59700 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725843AbeIGNlj (ORCPT ); Fri, 7 Sep 2018 09:41:39 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id 10FD5208AE; Fri, 7 Sep 2018 11:01:40 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from localhost (AAubervilliers-681-1-30-219.w90-88.abo.wanadoo.fr [90.88.15.219]) by mail.bootlin.com (Postfix) with ESMTPSA id D5110206FF; Fri, 7 Sep 2018 11:01:29 +0200 (CEST) Date: Fri, 7 Sep 2018 11:01:29 +0200 From: Maxime Ripard To: Andrew Lunn Cc: Laurent Pinchart , Archit Taneja , Krzysztof Witos , Rafal Ciepiela , Boris Brezillon , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Kishon Vijay Abraham I , Andrzej Hajda , Chen-Yu Tsai , Thomas Petazzoni , linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org Subject: Re: [PATCH 02/10] phy: Add configuration interface Message-ID: <20180907090129.yg5m5h7ocoow5xbv@flea> References: <8397722.XVQDA25ZU6@avalon> <20180906144807.pn753tgfyovvheil@flea> <20180906162450.GA26997@lunn.ch> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="3efarss5q7c4qdy6" Content-Disposition: inline In-Reply-To: <20180906162450.GA26997@lunn.ch> User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --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--