Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1004955imm; Thu, 6 Sep 2018 13:43:18 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaNGhgIRmSvNDrOiYD9bpNVkM+HmW8i+8G3t5kmhHjyJXLhvXDABuSuel6w1TPG6HC0SIML X-Received: by 2002:a17:902:2804:: with SMTP id e4-v6mr4514162plb.327.1536266598268; Thu, 06 Sep 2018 13:43:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536266598; cv=none; d=google.com; s=arc-20160816; b=Ve5rDssPRPCOnOCnYtkSSZqiVBe2tPjCFBSlSeJhJ3VMAb3tQEr8pRB0GhjnWBQRu+ MaLeRFAKv/btvwFPRR9Wd5sBUPdoeepr++TDdwhbC46ZsiDStC2S1bFcXAfDdqX6FUJK xwB74soqGU10uoZhottKXkIwqeisyQyHtz7KCYgdRjInvTOFReJEG6gMbrSh4moLr9dG B+Eghikh+smRa84ouqJXHduzKqeAaIO0blV3SrT2mz0j2wEx+Tg0QE9Lkb1NYRZqTI6+ 5aftkmRhU+mL1D+bTQOhuhMl9aUs0U30GWKLbXlHGVeXfcX3mDsqfD0C7mNXcZDLYW8i H3ew== 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:dkim-signature; bh=86ZO1VOgKjDMaOlKxCyLMygUxVimyqELMwSAZ6biafM=; b=fKY+KUvGz3jbm/ZdP7DuT02vw8hEfEm5Dxl4NGjpS9dFs4vd3axq7bMh9ZzK4PH6jB LTNkgzMawTc/JmlQg/Ueec44Di/NDSQWLAMm/Ysni0NmTce9gjv6jMxk/vlgSLPQuwT8 G2qq3SkFleDQx2ab10OdOjE6JETXAtMNHVVYAwUADuuzuRFQN+A1m/9YgSJW5o/g0dsS M4JBoOEwGX9hqSgx22U3XtiG+aPE9lFmy5vufWMrOGAmCjRHqsgWAFUUSXcCZpogGLr4 HQU4BTC8ya0RycTNeb2ymJzUEyXEWNU8QSEFI+NMVY5SsI8fKQjSO21Vr0frNvtqaORa W2Zw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=tezSezxP; 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 h2-v6si6294688pgk.330.2018.09.06.13.42.59; Thu, 06 Sep 2018 13:43:18 -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; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=tezSezxP; 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 S1727862AbeIFVBf (ORCPT + 99 others); Thu, 6 Sep 2018 17:01:35 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:54787 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725999AbeIFVBf (ORCPT ); Thu, 6 Sep 2018 17:01:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date; bh=86ZO1VOgKjDMaOlKxCyLMygUxVimyqELMwSAZ6biafM=; b=tezSezxP7TtBm0dTiBR85ZJmysV3uYyremy9dqUE84lhVELBcwkLkhGDQmQchp+STYyTpLtgtgUtZ3EqmA0RLRCrS4Oa2G/93+bVB7QWxcZ+QRyvMUMhDXA5lmVvaq9u8vMXNbH6JLjiO7bqCpTOp3yeLfddwmQIhuAqRvpfVlo=; Received: from andrew by vps0.lunn.ch with local (Exim 4.84_2) (envelope-from ) id 1fxx5O-0007C6-Hg; Thu, 06 Sep 2018 18:24:50 +0200 Date: Thu, 6 Sep 2018 18:24:50 +0200 From: Andrew Lunn To: Maxime Ripard 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: <20180906162450.GA26997@lunn.ch> References: <8397722.XVQDA25ZU6@avalon> <20180906144807.pn753tgfyovvheil@flea> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180906144807.pn753tgfyovvheil@flea> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > > +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; > > > > Shouldn't you report an error to the caller ? If a caller expects the PHY to > > be configurable, I would assume that silently ignoring the requested > > configuration won't work great. > > 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. 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. Andrew