From patchwork Wed Jan 17 22:38:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hugo Villeneuve X-Patchwork-Id: 763579 Received: from mail.hugovil.com (mail.hugovil.com [162.243.120.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A324328DB4; Wed, 17 Jan 2024 22:39:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=162.243.120.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705531160; cv=none; b=nA9uu9zuhHLcSmFGmyHxw5URPCZtfKXdGR/ZJqpYdM7q2ZibMwylAR23+3g8Q4/S+77FvgO4Hv0b3bBH54ZC1Qhh8dpe6WT03+GGahFIrGgjPaHEhJ3++u11LXDGFVCAsKqVb3fna47rJBouqwRjHZpB0m7vDvWSByQ7uM9UrS8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705531160; c=relaxed/simple; bh=Rsyz0+7XNwS5ijQpmCEI4juJDmLRHXka0w2i/GkW2Ug=; h=DKIM-Signature:Received:From:To:Cc:Date:Message-Id:X-Mailer: In-Reply-To:References:MIME-Version:Content-Transfer-Encoding: X-SA-Exim-Connect-IP:X-SA-Exim-Mail-From:X-Spam-Checker-Version: X-Spam-Level:X-Spam-Report:X-Spam-Status:Subject:X-SA-Exim-Version: X-SA-Exim-Scanned; b=RuhA43xpOjVFaAm+JnPLdWLEc79UO18XZjIAhsvtNKBrr/Qx7c+tiSVGCw2yIp1YSJx/UI4+dZeruw1AYjzBEA9+/+30PAE5PU8mf+qFRtokE/18i+6xRXlvqk1MXwhMCZrYHallpj7QFKJMFnZV/Bv8YfJyvYnaln9uqTiPD6g= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=hugovil.com; spf=pass smtp.mailfrom=hugovil.com; dkim=pass (1024-bit key) header.d=hugovil.com header.i=@hugovil.com header.b=oV/wu5nx; arc=none smtp.client-ip=162.243.120.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=hugovil.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=hugovil.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=hugovil.com header.i=@hugovil.com header.b="oV/wu5nx" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=hugovil.com ; s=x; h=Subject:Content-Transfer-Encoding:MIME-Version:Message-Id:Date:Cc:To :From:subject:date:message-id:reply-to; bh=0c7ABCOCZAR2KTCJxXITxEzTaBHcJ1Li6zuPuka9lxQ=; b=oV/wu5nxz+uRRXWf4WslsoI16S +o/rLYJaU80oGH2KiZohlkktt8n/0QO9qP9vYPcX2fB9h4vcwWsho3KVayI/uzPM2bQvW/Sr+5TqB zRPiO3KyvwiK/A+m7LFc8uXYhxCUJc/RzIK5jBP2I0YtsBkRO4bJWjsLv5p7J6yTSPdA=; Received: from modemcable168.174-80-70.mc.videotron.ca ([70.80.174.168]:52924 helo=pettiford.lan) by mail.hugovil.com with esmtpa (Exim 4.92) (envelope-from ) id 1rQEZ1-000155-T3; Wed, 17 Jan 2024 17:39:16 -0500 From: Hugo Villeneuve To: gregkh@linuxfoundation.org, jirislaby@kernel.org, cosmin.tanislav@analog.com, andy.shevchenko@gmail.com, shc_work@mail.ru Cc: linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, hugo@hugovil.com, Hugo Villeneuve Date: Wed, 17 Jan 2024 17:38:49 -0500 Message-Id: <20240117223856.2303475-12-hugo@hugovil.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240117223856.2303475-1-hugo@hugovil.com> References: <20240117223856.2303475-1-hugo@hugovil.com> Precedence: bulk X-Mailing-List: linux-serial@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-SA-Exim-Connect-IP: 70.80.174.168 X-SA-Exim-Mail-From: hugo@hugovil.com X-Spam-Level: X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * -0.0 T_SCC_BODY_TEXT_LINE No description available. Subject: [PATCH 11/18] serial: max310x: use dev_err_probe() instead of dev_err() X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.hugovil.com) From: Hugo Villeneuve Replace dev_err() with dev_err_probe(). This helps in simplifing code and standardizing the error output. Signed-off-by: Hugo Villeneuve --- drivers/tty/serial/max310x.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/tty/serial/max310x.c b/drivers/tty/serial/max310x.c index 048ae432ba48..701bf54e4084 100644 --- a/drivers/tty/serial/max310x.c +++ b/drivers/tty/serial/max310x.c @@ -1275,10 +1275,9 @@ static int max310x_probe(struct device *dev, const struct max310x_devtype *devty /* Alloc port structure */ s = devm_kzalloc(dev, struct_size(s, p, devtype->nr), GFP_KERNEL); - if (!s) { - dev_err(dev, "Error allocating port structure\n"); - return -ENOMEM; - } + if (!s) + return dev_err_probe(dev, -ENOMEM, + "Error allocating port structure\n"); /* Always ask for fixed clock rate from a property. */ device_property_read_u32(dev, "clock-frequency", &uartclk); @@ -1299,8 +1298,7 @@ static int max310x_probe(struct device *dev, const struct max310x_devtype *devty if (freq == 0) freq = uartclk; if (freq == 0) { - dev_err(dev, "Cannot get clock rate\n"); - ret = -EINVAL; + ret = dev_err_probe(dev, -EINVAL, "Cannot get clock rate\n"); goto out_clk; }