Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1859982pxk; Tue, 1 Sep 2020 09:25:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyXPbKpXRnof736lbOCcLx5J2xkHBdgnrFi23zFwrPZLDzY4LcrB54xnHgyDrPRz7GOiuil X-Received: by 2002:a17:906:59b:: with SMTP id 27mr2346896ejn.56.1598977518476; Tue, 01 Sep 2020 09:25:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598977518; cv=none; d=google.com; s=arc-20160816; b=gdTM98jR4iUwgKYz/C+fYbZTbN4Sgg63hW7koKhCrGyV/Rw0M7fGjph8w+9o0u9ipH JtgiOfu92QH8mvtw6X2BBvAPnWg7+SHK2Npv6x/KXS0UkYnKTVycqDE7xRfXrS/6HStw 9dXMIjvrFgldwIzhCoiLyipYfrFPFAf6Q9pP/4PrrJCsJa1ecdbdSRwkDdSzaAcL2eSm 28nFn6WwDOJO1mko6oj6eA2VRu89L6Hta/+0AaQQnhDNqMxSdViXR5lSzIe0LXpsNL4A ntt8kfG3yB2T/eGuPonIllvugWDm7th2BpzWvDtQ0YOc4650Zo2cbWOFB2Zx2MKh4WeT VMlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=cGiClVAyNj5DMOSe1xGrO9u7weiPl9NizT7sMjBHgVc=; b=XoCXK19gZEdXLV7DnUb3MEmQwrjh3amxdEhwrJIT2uySWuW3o9r1ooOOZK1Zp05DtC Q1r2QP0a9G7GT6/ZK+K0YiOCVtyVbsufm3v3vh13L8zZN6JC02Mx/3h2yHEC5P500XtA VhfW/CfJK6wNzrBFFZv3XwGdDRN9AY3t4xr3VdNqorj18zYHsMFRbNBnAvUpOiRVqzYN EDylUu2oQHI9ds3Z4vjOhfFKQ1/QRV1QbzVRCYoKXge3QZ5nAWZa/9dI6epuKRswdhOd /zRd6Mfe7GUFYW65Em/7EsSmdwiu4J1VRvF1rPK9f+d8GIziXol9WAXw+nJ0+cceiULT SKRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=FgtprEia; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u6si887850eje.234.2020.09.01.09.24.54; Tue, 01 Sep 2020 09:25:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=FgtprEia; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731040AbgIAPcY (ORCPT + 99 others); Tue, 1 Sep 2020 11:32:24 -0400 Received: from mail.kernel.org ([198.145.29.99]:34034 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730681AbgIAPbO (ORCPT ); Tue, 1 Sep 2020 11:31:14 -0400 Received: from kozik-lap.mshome.net (unknown [194.230.155.106]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E8E20207D3; Tue, 1 Sep 2020 15:31:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598974273; bh=hRHvPfyODUedIyJaZ2MhAzqCT6E0WyLbz0tk8Et2M10=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FgtprEiaMA12V+a4eyAMQvqBuq0zq5O53C9sAgIyGMapnQCQgnol0g7xMHGMnvaY/ HisXdopg/V+c4VPOzODcDXCuOYVh1XgZbJXFyUpA8xnOFKD68ZN4Z+4pyWDrzmiESN qZG//G04yUF3xG9pRIjGO0wUSjRW/psTPS5kioy8= From: Krzysztof Kozlowski To: Greg Kroah-Hartman , Jiri Slaby , Florian Fainelli , Ray Jui , Scott Branden , bcm-kernel-feedback-list@broadcom.com, Nicolas Saenz Julienne , Paul Cercueil , Lukas Wunner , linux-serial@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Krzysztof Kozlowski Subject: [PATCH 2/2] serial: core: Simplify with dev_err_probe() Date: Tue, 1 Sep 2020 17:31:00 +0200 Message-Id: <20200901153100.18827-2-krzk@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200901153100.18827-1-krzk@kernel.org> References: <20200901153100.18827-1-krzk@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Common pattern of handling deferred probe can be simplified with dev_err_probe(). Less code and the error value gets printed. Signed-off-by: Krzysztof Kozlowski --- drivers/tty/serial/serial_core.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c index f797c971cd82..2c52e0457faf 100644 --- a/drivers/tty/serial/serial_core.c +++ b/drivers/tty/serial/serial_core.c @@ -3264,9 +3264,7 @@ int uart_get_rs485_mode(struct uart_port *port) if (IS_ERR(port->rs485_term_gpio)) { ret = PTR_ERR(port->rs485_term_gpio); port->rs485_term_gpio = NULL; - if (ret != -EPROBE_DEFER) - dev_err(dev, "Cannot get rs485-term-gpios\n"); - return ret; + return dev_err_probe(dev, ret, "Cannot get rs485-term-gpios\n"); } return 0; -- 2.17.1