Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp854183ybi; Fri, 2 Aug 2019 05:27:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqxLmWz68uKsGd1yptFTtJBwG/FI1fWa0ytl8DkRrqvZuuDg1hGOHsmkRGmz07OQ+UbK4tqJ X-Received: by 2002:a17:902:2aea:: with SMTP id j97mr118183427plb.153.1564748861842; Fri, 02 Aug 2019 05:27:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564748861; cv=none; d=google.com; s=arc-20160816; b=EB1xlMa67G0eqpGo0i7dwGgtRdiPTY6N0nS5iAKVDV0xA7MlS5qU1ZT1xeEs0feMrq rLcaLQiOzd5gxMTCrZ+iKnRwr6dpMFA77mJmWiFvEtOli9Fk2h5HsduIDbdL6UHtVJ1p CtHCWK32Hw8qiompiYO13ua88nyFfSZAbnY99o9wkCfFCm9y5a28jBr8CZAuA6+uHadi XWTDim1EUDy5VJfmvhtKpUocx6wqfiSxhY1TUirjqP6Ulp7IVD9rYYsI9865pcKMwy+o OgpL2PQ9DOR4v0SEqp6fU6FOqyIouCsPPedpN0VTV0kInOBykNROfxexQFvnvN1qywhw DryA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=RK+20dzJviISNV+93NqcQswZxg+GA6BYaDL2+ThvHdo=; b=kf48m7PtoqR4veRGZiYVjFpiz+gvvm9ikrMvGkpCLDLquJX1oqaLsr0VThWP+mntGj tQzUtXrFYy56lNUegwPeXDBF11tpev6FGVPnTHh0S3+qnJc8qr6gRxxOMtqS5sjXAhR+ p6IKcuU5qTUJpIUDlwK2V2po6DBa1CcDI5/glXcDcSpuYR8kfyH/yEDBy995KNYcaOVk LVO3IULiWQoV08hgOaMvTmQEwBd7vd071NU9SR9xebAMrRDloLHC2uc44EwZ04NAepsD E6PS/6A8mzZA7q+svyDVYpEYVJhK9BDsCQh/EnBu6xQqg73AZFHZsDpdXWUnZhyZqTbR 9pGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=no2YBNHW; 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 r72si6585325pjb.33.2019.08.02.05.27.26; Fri, 02 Aug 2019 05:27:41 -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=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=no2YBNHW; 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 S2389333AbfHBHHK (ORCPT + 99 others); Fri, 2 Aug 2019 03:07:10 -0400 Received: from mail-ot1-f66.google.com ([209.85.210.66]:41298 "EHLO mail-ot1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388184AbfHBHHK (ORCPT ); Fri, 2 Aug 2019 03:07:10 -0400 Received: by mail-ot1-f66.google.com with SMTP id o101so77103562ota.8 for ; Fri, 02 Aug 2019 00:07:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=RK+20dzJviISNV+93NqcQswZxg+GA6BYaDL2+ThvHdo=; b=no2YBNHW/GBW+3zkl06td4ZCgKjOAclq31zEfcew3umEuTOHp+y3OkHj0zTVM7aidw KdmGFIJwKTrVJjKKmBPgtwqN/fjYzBiAum5/8x6lGM5DKiHPLhAoGYnwuD08sLd3DlXa c8tQor2wpWzik/ma0YaljlGnHaFElfvNCS3AM/5uaNAv9RnNG1/Py2U2iEtiTKSqU+fw c+ndr6PvcF98I5p1rfZgrZjVhuC1wYHtmSHU1/xR0wlECKO5NRZ+zDMejW2TnPHxrT9O w33Ymg9gztLH/rncYfEBsciVUElBQO4iISkC7hrLYbE0t2yINQYV+GoPs4AZv7l6jgrx KPgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=RK+20dzJviISNV+93NqcQswZxg+GA6BYaDL2+ThvHdo=; b=P6Lfbuu4UTlCTPskK/YdvogqGiOkT3Iiby+TFAZLBhQSXPm3V8xzJwm/CqnLjFefEB JAWIv4+HkTa1XJFyJ/PaowoVMJ6ypNQI3hTItsdRUfeOTMc5vQGE1x3H63URu7gpQSwm G9qbCI7h1wKmdHjSoEKwIEOS7mY4yn3wjc2Fppd2wFS32lp1NOjaKGGh4xhyE83E8rNW 7Ul5iZ2mKTXBFTySNbjyiOhWomFtCP+Mf7ujMcGFKd3H734EColR/mxBu5qxrn/NmpBJ qLqnnxxduzoRRf+z2Tu6ct3+fdW7sB7+TUpp96kWwHSRjhgwIrRLTEr71sUgRYUg9ev5 uE8Q== X-Gm-Message-State: APjAAAU2nFuMUksJsUEv0Av6njKyglYCGI0A0SPQfYPiECTHW0+roWz1 qADvhn5Ds9GYMq7WwjfDTDXEUu9gFxMDlQoztonU3g== X-Received: by 2002:a9d:7352:: with SMTP id l18mr37650695otk.292.1564729629450; Fri, 02 Aug 2019 00:07:09 -0700 (PDT) MIME-Version: 1.0 References: <20190801084439.36487-1-Anson.Huang@nxp.com> In-Reply-To: <20190801084439.36487-1-Anson.Huang@nxp.com> From: Bartosz Golaszewski Date: Fri, 2 Aug 2019 09:06:57 +0200 Message-ID: Subject: Re: [PATCH] gpio: mxc: Use devm_clk_get_optional instead of devm_clk_get To: Anson Huang Cc: Linus Walleij , linux-gpio , LKML , dl-linux-imx Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org czw., 1 sie 2019 o 10:54 napisa=C5=82(a): > > From: Anson Huang > > i.MX SoC's GPIO clock is optional, so it is better to use > devm_clk_get_optional instead of devm_clk_get. > > Signed-off-by: Anson Huang > --- > drivers/gpio/gpio-mxc.c | 9 +++------ > 1 file changed, 3 insertions(+), 6 deletions(-) > > diff --git a/drivers/gpio/gpio-mxc.c b/drivers/gpio/gpio-mxc.c > index b281358..7907a87 100644 > --- a/drivers/gpio/gpio-mxc.c > +++ b/drivers/gpio/gpio-mxc.c > @@ -435,12 +435,9 @@ static int mxc_gpio_probe(struct platform_device *pd= ev) > return port->irq; > > /* the controller clock is optional */ > - port->clk =3D devm_clk_get(&pdev->dev, NULL); > - if (IS_ERR(port->clk)) { > - if (PTR_ERR(port->clk) =3D=3D -EPROBE_DEFER) > - return -EPROBE_DEFER; > - port->clk =3D NULL; > - } > + port->clk =3D devm_clk_get_optional(&pdev->dev, NULL); > + if (IS_ERR(port->clk)) > + return PTR_ERR(port->clk); > > err =3D clk_prepare_enable(port->clk); > if (err) { > -- > 2.7.4 > Patch applied, thanks! Bart