Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp7129783ybi; Thu, 1 Aug 2019 03:38:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqxD1JWZbPm9IHcNdG/mfvOBi89XilkhY8eNbkG/kharOioqVMdUNp9PzRbxFE0/TpZm3RhZ X-Received: by 2002:a17:90a:cb18:: with SMTP id z24mr7717653pjt.108.1564655937423; Thu, 01 Aug 2019 03:38:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564655937; cv=none; d=google.com; s=arc-20160816; b=QuLxQKyAvbnBX8KsYUTVrOwgGLvZgxs9R1g8lDXCyltOj760Fnk8Hk2ED3jLwYsLHK puhOnwJW7/p4d4yO1vsZZS5JvlIjor9pT7mGuq+yNRljJp+lmjH4VPip9LEz8zotXEkv y3Ngj22l1VpRNgZWvmSDqYtrbrRDU0V5V55zhq4MEcFeXF5TFY6uUjKsqDjE4ziZyh3U 4JGSaVVs+KYcELbYUSoYlJueIExhBWpi5tCDX3VPtmpoVEDxdbQQRK8nxtb6qTObO5on Smv0O2IJJCmCX9WIHV+FGg0W+t2F1yMvF48iadeh03v9Hq3RzjheUKd9ghg7gbBBuiLM mpXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=ez8AfrLgeLjhMharDU3eEQBmhcmBAyST7UyuF7gfB2w=; b=uSAyURpRjnGN+p3MA/6glfkgHLVfXLXPWFKmO67uQK8CTUn7SYHuRzNYU3vmaXMv8G 5HGvyb+sASOkcNI20WhYEHKEzsgny8sGy8el/qDmXxxDaH0n1eecLwySk9X2xlk+ccTJ nWLP2CPvOLWWhS7NoeF/pNQKSWxp1h4rum5AgWqokevYsttcOwb7rsceozhkZVwYcdM5 b1MTnZHflO3mQpmc7TXqrl/GQA9OKQCfOvcITMy8OfocmTOVEXR5D1mHeEFIE50PncAN VozF+b7juztbxrboBmLQsGeECKvn31E4YQIvZtFVQ7qZmWEu15+3f3U4j1gO4fgH7KIX vorw== 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=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 205si7052349pge.295.2019.08.01.03.38.41; Thu, 01 Aug 2019 03:38:57 -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=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730710AbfHAIyM (ORCPT + 99 others); Thu, 1 Aug 2019 04:54:12 -0400 Received: from inva020.nxp.com ([92.121.34.13]:50582 "EHLO inva020.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730482AbfHAIyM (ORCPT ); Thu, 1 Aug 2019 04:54:12 -0400 Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 941681A02C1; Thu, 1 Aug 2019 10:54:10 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 839C71A02D9; Thu, 1 Aug 2019 10:54:07 +0200 (CEST) Received: from titan.ap.freescale.net (TITAN.ap.freescale.net [10.192.208.233]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 5D57E402D7; Thu, 1 Aug 2019 16:54:03 +0800 (SGT) From: Anson.Huang@nxp.com To: linus.walleij@linaro.org, bgolaszewski@baylibre.com, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Linux-imx@nxp.com Subject: [PATCH] gpio: mxc: Use devm_clk_get_optional instead of devm_clk_get Date: Thu, 1 Aug 2019 16:44:39 +0800 Message-Id: <20190801084439.36487-1-Anson.Huang@nxp.com> X-Mailer: git-send-email 2.9.5 X-Virus-Scanned: ClamAV using ClamSMTP Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 *pdev) return port->irq; /* the controller clock is optional */ - port->clk = devm_clk_get(&pdev->dev, NULL); - if (IS_ERR(port->clk)) { - if (PTR_ERR(port->clk) == -EPROBE_DEFER) - return -EPROBE_DEFER; - port->clk = NULL; - } + port->clk = devm_clk_get_optional(&pdev->dev, NULL); + if (IS_ERR(port->clk)) + return PTR_ERR(port->clk); err = clk_prepare_enable(port->clk); if (err) { -- 2.7.4