From patchwork Wed Dec 27 05:21:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 122757 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp1773875qgn; Tue, 26 Dec 2017 21:34:52 -0800 (PST) X-Google-Smtp-Source: ACJfBosL1TurpzXGiAXB+/amcDyIndHR5AF9Wg1/VKDRbZDD4R1vD4SdLQPG9m+fhV0Ciis2/VrP X-Received: by 10.159.231.20 with SMTP id w20mr28358641plq.398.1514352892478; Tue, 26 Dec 2017 21:34:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1514352892; cv=none; d=google.com; s=arc-20160816; b=rZWCzHns1GUJ1tzDdTGr9f5iPdjaNccvuI2BiKHsp1TBPXT/DodEmoyecCzfTOfCfK 9vW/bRMypGiG5g+fusF8ZF1Eat/Gj7jGS7tRen/IDiF5VFao90OBPrTjOY0hc3h2tVSD xXEBLtD5TnPqQFxXm4QnKAyrOo5KjGasXAcZDkSkkixWbkd0HrvxOk2maLta6TZRxzS/ yCEHCMAJ7BOnirmVb9FvdvdcPKWBfIslhYC5wDDuNot0oM7mU4DIHM8LDgY+7KqARV+n s/U4iC+2PheCqNfGO6b5BnxwEbilweRvtDUDFgLwIYuKrsAkCS9JBVsBSe/narVW8pdg vOqQ== 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 :dkim-signature:dkim-filter:arc-authentication-results; bh=56r48Qd3phYJB2eqwVyFxBuTB8QRcI5mZI94MjS4BU8=; b=lrV8CBLEr6ASlNQBQK8SfsQm71eWV7UjSg0fCYl7qbKinRmFma988CJ94Dr/Oz08uh hAyO8RRLhFVMwHY7rxigPA4G3L8SrsFbR6ZbHa9pe7Q3dr++SsYaNiynmbxt5/N7ERsE T7X34PgTLcaPeTiB97kp3PTK4AXeH8ziOnRuJ1fRyVNQbvZ/BpjTMulbIIcFzfpYHOoV eDkAoY/w3DXYmM647BQHqDtH+ho2Vh7m4bJ58oHnRd7Vw0IZ6EBWhokrmRrbBwEAhHQ3 1adusZ+QWVYzn5sjkPuDgkCLdc/WN91nd/ed88wQl789DKrrHBykgstTg6fh1HNUF7EC tg3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=UtTxJpWs; spf=pass (google.com: best guess record for domain of linux-serial-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-serial-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 e3si24283430pfg.23.2017.12.26.21.34.52; Tue, 26 Dec 2017 21:34:52 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-serial-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=UtTxJpWs; spf=pass (google.com: best guess record for domain of linux-serial-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-serial-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750952AbdL0Fev (ORCPT + 2 others); Wed, 27 Dec 2017 00:34:51 -0500 Received: from condef-09.nifty.com ([202.248.20.74]:61189 "EHLO condef-09.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750947AbdL0Feu (ORCPT ); Wed, 27 Dec 2017 00:34:50 -0500 X-Greylist: delayed 473 seconds by postgrey-1.27 at vger.kernel.org; Wed, 27 Dec 2017 00:34:50 EST Received: from conuserg-10.nifty.com ([10.126.8.73])by condef-09.nifty.com with ESMTP id vBR5M7dg000340 for ; Wed, 27 Dec 2017 14:22:08 +0900 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-10.nifty.com with ESMTP id vBR5L5Fs009381; Wed, 27 Dec 2017 14:21:06 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-10.nifty.com vBR5L5Fs009381 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1514352066; bh=J+5hdf626o7r3DL4QIezd585o54a6xz9qwKZQdUEWww=; h=From:To:Cc:Subject:Date:From; b=UtTxJpWsB7WdgcUrAA6g5qIwBClSLRyiRd5WF0KEeASh9hC7HgeIeXCtSRHReXH9L uNWFm/NiLlcQC5B9g/ebK63X6b59sSzVxIzpjcepg49DLnDTAhg74q3iQGvnzbUGDE EzSPGRMQIgeMKYajhtcp02sLZ7SoDqfY2IM7NHHGpAeV6Z8ttbHjU1uelDEgfRFKRy QRKf1as3Hf9ZAlmpiFFOqdq0Vbn8sTwSAYTbmYFCNS9j79ihRLT06SXUJ/lBECYgUR Je1tjjto9nlhz5sXPONGdajgupYrg4vVj06+WO1e1D4LFsMpNFlsXegOuqbYl5v4gS UodXsDTZdZe5Q== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: Greg KH , linux-serial@vger.kernel.org Cc: Arnd Bergmann , Joel Stanley , Philipp Zabel , Masahiro Yamada Subject: [PATCH] serial: 8250_of: fix return code when probe function fails to get reset Date: Wed, 27 Dec 2017 14:21:05 +0900 Message-Id: <1514352065-7777-1-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 Sender: linux-serial-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org The error pointer from devm_reset_control_get_optional_shared() is not propagated. One of the most common problem scenarios is it returns -EPROBE_DEFER when the reset controller has not probed yet. In this case, the probe of the reset consumer should be deferred. Fixes: e2860e1f62f2 ("serial: 8250_of: Add reset support") Cc: stable@vger.kernel.org # v4.13+ Signed-off-by: Masahiro Yamada --- drivers/tty/serial/8250/8250_of.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) -- 2.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-serial" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Reviewed-by: Philipp Zabel diff --git a/drivers/tty/serial/8250/8250_of.c b/drivers/tty/serial/8250/8250_of.c index 1e67a7e..160b890 100644 --- a/drivers/tty/serial/8250/8250_of.c +++ b/drivers/tty/serial/8250/8250_of.c @@ -136,8 +136,11 @@ static int of_platform_serial_setup(struct platform_device *ofdev, } info->rst = devm_reset_control_get_optional_shared(&ofdev->dev, NULL); - if (IS_ERR(info->rst)) + if (IS_ERR(info->rst)) { + ret = PTR_ERR(info->rst); goto err_dispose; + } + ret = reset_control_deassert(info->rst); if (ret) goto err_dispose;