From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.5 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,FAKE_REPLY_C,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 011F8C432C0 for ; Mon, 18 Nov 2019 14:24:36 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CAAF02084D for ; Mon, 18 Nov 2019 14:24:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="cETe4UPs"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="0DBwzJUV" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CAAF02084D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Owner; bh=lz+gQLuRxJQXDGHqLUbOQDaHMFx93+87FzfrS70yRXA=; b=cETe4UPsSeuDt8 ZMURAAR0KL1gDNctnNe3O0M2wv/ETLeZuqdYwH90d9lWT4D5XAhtqIp+UnKk1uWn5fpLUWakXXRwc BHKPKpgr84tQDpv1vmjKWinAwEI2MWCoay500cRPbELOKJJIaLPVGKMxj6G651Hoa5YubxkW++Jxv FzvGj+FXJT3nDjsu2Kp07jpUqd+ASJKEBSLG/laxgRzhdsVOzJaC4o7QKXphZy/XxxOoAXKb/x7be dIpS64ry7AZXG4biINheecGnpH8+gI5vDjxDZhecz2yCchacjXdJozSegvq7ADN3hv62lrm3k07b0 Igb2QRcwNOP20w4zpPZA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iWhxC-0002Qz-7n; Mon, 18 Nov 2019 14:24:34 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iWhx9-0002Q4-VZ; Mon, 18 Nov 2019 14:24:33 +0000 Received: from localhost (173-25-83-245.client.mchsi.com [173.25.83.245]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 243BD20692; Mon, 18 Nov 2019 14:24:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574087070; bh=MmJPqaX8nGIZrh4Dibpts0t0Dtr9+u4xiU8n8NZNzFk=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=0DBwzJUVz38PqTslrSrR99DBp0hhvJbtqNfpwBRRVJbr7NcsFqytNsE/o0HBgS1kJ m3e/oSIVp8rb5/IncQZO8v5/NjAcHywY71Ipbs2juUEgDOTwnwOZ5+drB+CyqiaBqw vN5Ch3XYMbzCfTXFa8f7oxKXQ5BFt8J/2GNyvQOo= Date: Mon, 18 Nov 2019 08:24:28 -0600 From: Bjorn Helgaas To: Mark Brown Subject: Re: [PATCH 2/2] PCI: rockchip: Simplify optional regulator handling Message-ID: <20191118142428.GA27459@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20191118115930.GC9761@sirena.org.uk> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191118_062432_037521_DF1C5BE3 X-CRM114-Status: GOOD ( 11.99 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: lorenzo.pieralisi@arm.com, heiko@sntech.de, linux-pci@vger.kernel.org, shawn.lin@rock-chips.com, lgirdwood@gmail.com, linux-rockchip@lists.infradead.org, andrew.murray@arm.com, Robin Murphy , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Nov 18, 2019 at 11:59:30AM +0000, Mark Brown wrote: > On Sat, Nov 16, 2019 at 12:54:20PM +0000, Robin Murphy wrote: > > Null checks are both cheaper and more readable than having !IS_ERR() > > splattered everywhere. > > > - if (IS_ERR(rockchip->vpcie3v3)) > > + if (!rockchip->vpcie3v3) > > return; > > > > /* > > @@ -611,6 +611,7 @@ static int rockchip_pcie_parse_host_dt(struct rockchip_pcie *rockchip) > > if (PTR_ERR(rockchip->vpcie12v) != -ENODEV) > > return PTR_ERR(rockchip->vpcie12v); > > dev_info(dev, "no vpcie12v regulator found\n"); > > + rockchip->vpcie12v = NULL; > > According to the API NULL is a valid regulator. We don't currently > actually do this but it's storing up surprises if you treat it as > invalid. I don't know anything about the regulator API, but the fact that NULL can be a valid regulator is itself a little surprising :) _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel