Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1372831imm; Wed, 19 Sep 2018 17:39:19 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbXPGwiZ0Ml5F7+/lqul167HEVqgXPvB4iQknA/Ck6o1EhK3uzV1H5d59Xe3djsYDhvEuWM X-Received: by 2002:a62:e511:: with SMTP id n17-v6mr38177616pff.210.1537403959468; Wed, 19 Sep 2018 17:39:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537403959; cv=none; d=google.com; s=arc-20160816; b=lI89HGQD7dmD9twtOfxRjno6hTb4CJb0ENnoPSzvGF/YCjttL3jPSwFU97N8vZ3PaT BWH4NNdbNDo1UQX26LW+Fqhyco4mVXnGAeEHjwb+mpTw6wgaGsKSUBCbHAkK7E2lAunZ j23wtXC3bEtWLqAWBLRsyeDKQzoExMB+XYkOKlx9O7BhNlXljh3qM0j8gGn2eQVUH5A+ sbIkI7n7BN8r6xy76S8QJlGU4iOdjXMUJCY6hR1S6emHKCNJKlrUQwfRKz1G6C/Xy67O pH2BvsDbUgTtXbotC4fxXJbWNrkFwB7vpRcZ4rEUeeJ1FkkgWwP3v/v2YbatzakI51h+ J3Xw== 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=jd+uduVGP3rDeLGP4L2jbt/wHWTlvBSul1Bbcvkbo34=; b=Y136Gvq1KNmal+YyMBNQow+EWG6f0viUQxBgKPuuPO6C0RnxljfuYqj1qL9llYPFuY wQ3AaMGb581mF3n5Z47JaCg7FqKXOX6Ee/98wHt2ZORjJnYKs4lMBfkjtyJGJMUMo9cW 9+rUDtu17PiOLDVyr3jBlAHYHodF9eUmShO5E1ixL6PrvCgwGX/QUPKW+Z5iBd52uuD5 cVX1a/QFyQKmrZp42pXtilx3PpXzZke1hhcgaiUQiLKYoUtmXOSo61K1Mtm+w4pSaIiK jPE0cvHauh0OjQdWafJ/KWIVpF1UYe3BfNwhIIBnQfQSMf4pinbo9FTh3Jk8omtpAsBc m9Iw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z11-v6si19932264pgv.138.2018.09.19.17.39.03; Wed, 19 Sep 2018 17:39:19 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731274AbeITGRD (ORCPT + 99 others); Thu, 20 Sep 2018 02:17:03 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:41698 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725904AbeITGRD (ORCPT ); Thu, 20 Sep 2018 02:17:03 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: sre) with ESMTPSA id 05C6B26B9CE Received: by earth.universe (Postfix, from userid 1000) id 74DEA3C0A85; Thu, 20 Sep 2018 02:36:30 +0200 (CEST) Date: Thu, 20 Sep 2018 02:36:30 +0200 From: Sebastian Reichel To: Baolin Wang Cc: Rob Herring , Mark Rutland , Linux PM list , DTML , LKML , yuanjiang.yu@unisoc.com, Mark Brown Subject: Re: [PATCH 2/2] power: supply: Add Spreadtrum SC27XX fuel gauge unit driver Message-ID: <20180920003630.ygvjnuutmd5n2vre@earth.universe> References: <1b3f165e2a806dd3d4b7712160ee3bda72f7d675.1536736399.git.baolin.wang@linaro.org> <1295864a38810a6db6c97e298c6663ae2b1350c1.1536736399.git.baolin.wang@linaro.org> <20180916143552.3oxjqpo6vravh5cy@earth.universe> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="x26i7pb5xajtvdfn" Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --x26i7pb5xajtvdfn Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, On Mon, Sep 17, 2018 at 12:01:51PM +0800, Baolin Wang wrote: [...] > >> +static int sc27xx_fgu_parse_dt(struct sc27xx_fgu_data *data, > >> + struct device_node *np) > >> +{ > >> + const __be32 *list; > >> + int i, len, size, ret; > >> + > >> + ret =3D of_property_read_u32(np, "reg", &data->base); > >> + if (ret) { > >> + dev_err(data->dev, "failed to get fgu address\n"); > >> + return ret; > >> + } > >> + > >> + data->gpiod =3D devm_gpiod_get_optional(data->dev, "bat-detect",= GPIOD_IN); > >> + if (IS_ERR(data->gpiod)) { > >> + dev_err(data->dev, "failed to get battery detection GPIO= \n"); > >> + return PTR_ERR(data->gpiod); > >> + } > > > > According to the binding (and the remaining code!) this gpio is not > > optional. >=20 > Yes, they are not optional. If we can not get the detection GPIO, we > will return errors. So am I missing something else? >=20 > Thanks for your comments. devm_gpiod_get_optional =3D> devm_gpiod_get The _optional variant will return NULL if the GPIO is not specified in DT. The variant without _optional will return an error instead. -- Sebastian --x26i7pb5xajtvdfn Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEE72YNB0Y/i3JqeVQT2O7X88g7+poFAlui64oACgkQ2O7X88g7 +pp72w/+PBMhziS4xo8Gk9wXxqq8FX5e54kd0AfV1i2CCeS5IG4vq6IoynmZ4EQv MVS3HdeX9LMZLoR1J2Me4U4yyyF77sLg3CBwiqdskj6nbukvlWFeyAutQcZ/eDod I9mNwK1oa0RvuItT6vfaAP9XZvnhqh3tze+TvPctpSG/bIXnmbY9Cla+MFnk6A2D logiPxnBWJoRQGZGZwwgD+iRZ1fM3k7WxoL+Qg4TE2ij0k82rjxS2zYNp75J8eFd 0tlOgnAVTJRtmbZimaJComDBAbMxelD52/Pip/QCXIPfgxAh9zymnUMPGMZVEwNx rqKfusukexOq8VUOMadZvhaoUAVHhzuRGnmV+qdjZ+eldhHir2XXv+q6av+pscl4 HBUKIfgbXDPX31Dbneo/AUfrhTbJzo6Hsaljy5HUsYLs1c2osm81ummcaivapfwE cy79x1afz5mMEhQV0MgJXECLzL0MGGIUxlY2jxUYKp/n36NAWhkksCM3y70O9ZyQ dmOp8QAm90j72byIjzsZxfHhfsnmwbYMdBCWP2l2nlBaVN+TQZMpYiRzQif/HQwq DXk+r07RUwvilJSA3KZH/7ZgV8r4NE2jaqzW2Uh+GFuLgsimS0u3HBi6WkoJENhe tf3cbDoADfGJ3QK+qj9OXLSQmEPmE9Xg0mV7vytj4tD6+bMZKdg= =Ikka -----END PGP SIGNATURE----- --x26i7pb5xajtvdfn--