Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2569815yba; Mon, 6 May 2019 08:08:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqxg4q3fNE4tnLOyJQiSR6elMwuh/h+ATgEhuccNt/E9XIhJfd6rESff013y0CtBX9mNLjUx X-Received: by 2002:a62:6497:: with SMTP id y145mr34439479pfb.255.1557155324421; Mon, 06 May 2019 08:08:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557155324; cv=none; d=google.com; s=arc-20160816; b=ykcaSTuXQrwPMWCWBhsqKdy9xxSH6qMm+J6sSWTl0q1YcZEAe9vpjF27CGboyRdsbV mw4825c2u6qIxRDWQxYu9yid81F8YqlpAZixWLGHLaMA0dgidx7eFk5IJqMwCqww6lx5 WUksZaUr8oHkM0YjdCpnlEN8YoiBprlQGt+OP2nHEAvnJjV98hQIsQS7cYAo2X0iaRlE GhcSlyQWbSmrQc/i7RuAAy/QhMjbjCyOBMwztcTs0JtByuWEiHMko10VCbwgQZCyhzv1 UIfFa3q9kEBrq2i3W8Rk1tg9FzTYPVDWReDZhwCiperr/lTsAY9olP9tT3vdQMBMZmKn eANQ== 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:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=caHSe4b+Kq4RbtQHaeYorhUURwbFjyfsHCWFQfg0+/8=; b=PCRsgz/dpf1kFSSbFcl5C4SV5bQwnI7Y9qWZYyT7SSbhLS0ZEO6ESAeoVXxULDwFUJ uupA/CqBvnkiyAVkK1HfySe9TuJRQPv1TletBkZWP49j12bvUkL4FntAW6A/0TQWpV5p nY77baYXbpfGn/UD/MhmPzBmBo/rUfMuL7j8HOhwyaYjS9RhsPmedYTbEaBGnnSKQbmU EyVW0CFrATmROpyu4Qd5b1g5OuSGXcg0vnPFuE7LJ3p8i9wsV4SNJPoyYsTO1TM2ISqo NipMpfAV7qSzgJrSy07J0/b53NEQoPvGdwzkgOrW1vhDMMkOup1BHDCvlAcPYAqaZrJj AzDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="Fx15v/a2"; 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 k63si11882034pfj.194.2019.05.06.08.08.24; Mon, 06 May 2019 08:08:44 -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=@kernel.org header.s=default header.b="Fx15v/a2"; 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 S1727620AbfEFPF5 (ORCPT + 99 others); Mon, 6 May 2019 11:05:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:59306 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727547AbfEFOiP (ORCPT ); Mon, 6 May 2019 10:38:15 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 B1A1920449; Mon, 6 May 2019 14:38:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1557153495; bh=l+vwBq8B0iCqSp7zzsk2DETMYixOA5pWhzYBakqzhJw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Fx15v/a2L1xN4Da0l14LrWpD9CtQyRz4Twb3j883wqaOp5KnZgHTNd/pLOzMlO0gJ ZcMVCzxUu1SKX5Zcn71V+TGwwlV1rJWwZpSasXu+8uqEMWWHF+t9Kg51/YymHXWmV+ Homu4gM4cql0m6PqqKrQgYOyVZQlOs81YooPHfmE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Anson Huang , Linus Walleij Subject: [PATCH 5.0 111/122] gpio: mxc: add check to return defer probe if clock tree NOT ready Date: Mon, 6 May 2019 16:32:49 +0200 Message-Id: <20190506143104.441736734@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190506143054.670334917@linuxfoundation.org> References: <20190506143054.670334917@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Anson Huang commit a329bbe707cee2cf8c660890ef2ad0d00ec7e8a3 upstream. On i.MX8MQ platform, clock driver uses platform driver model and it is probed after GPIO driver, so when GPIO driver fails to get clock, it should check the error type to decide whether to return defer probe or just ignore the clock operation. Fixes: 2808801aab8a ("gpio: mxc: add clock operation") Signed-off-by: Anson Huang Signed-off-by: Linus Walleij Signed-off-by: Greg Kroah-Hartman --- drivers/gpio/gpio-mxc.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) --- a/drivers/gpio/gpio-mxc.c +++ b/drivers/gpio/gpio-mxc.c @@ -438,8 +438,11 @@ static int mxc_gpio_probe(struct platfor /* the controller clock is optional */ port->clk = devm_clk_get(&pdev->dev, NULL); - if (IS_ERR(port->clk)) + if (IS_ERR(port->clk)) { + if (PTR_ERR(port->clk) == -EPROBE_DEFER) + return -EPROBE_DEFER; port->clk = NULL; + } err = clk_prepare_enable(port->clk); if (err) {