Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp2155641lqz; Tue, 2 Apr 2024 08:43:59 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU2k6UvMSjfD9F+8+i+qMiQhA4SJRnj2iHdQSfdwY1oeDrl9lw5b6onP26HBmjNY5vqaljiEdpFP8wmjtDgkcE1cJYjiMPNjQ6owvTlHA== X-Google-Smtp-Source: AGHT+IHM6PPILWcy+AOUflcLKNGC/YHBhBJ4ETCFLxyA++KVp3FK62cH+GnAHIvZOcH3J4vm+8eo X-Received: by 2002:a17:906:6683:b0:a4d:fcc9:905c with SMTP id z3-20020a170906668300b00a4dfcc9905cmr7555604ejo.20.1712072639377; Tue, 02 Apr 2024 08:43:59 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712072639; cv=pass; d=google.com; s=arc-20160816; b=Az6InIpzhIw5wi+TX/PaU7dAnS3ao0x+QAhshJSKS9ls6DCrcI0b2ON/KnI6kVbzVI uF7k0e6kVQhjFJUPWDf1cuzT+MRGYGmZ4hH+fsp9B4HlOnaPWtdVHSnL1tegd1O/xDzQ ek2jfustITjFuaVMD7icIHBGx0UeCwIXqogt/85pNp3UO5QHYhdd/Ec6BEYnMo4LkfSA PTZnVg22eKjPxy60HpIyNTj2uVfUtznWGZf3c0v8h36A3d2tgQ+K6qPir3hMvBwUHEmN qCsY1nARj+PRrt+gZIhvIWBsGO3DamKWwXvZB13+5ZkFpd4jkiM5TsplJpfWicHRn9UA hkgQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=Y4vjVXs9jwh97GmHi5MwGhnn4Q+VKilcnxjY2zcjcI4=; fh=G+kXbXZ7X6Rrw4sqwu0pPJ5LnQ6m545XsQoac6catcE=; b=KDXGiAVJGYj0JNZEQdl/CmPuF0OSYE23RMsbrjXK51lq2xbmy5821m+jSTVIYRqKQK wpmn1EWtdJSSSwq/aJGNiLopHhI911UbthvvTzZhlVJBY+YnUqAOm0Gdt3ADaeB/1Abi 0dqzfPrwhLhwiOQb8TMQSi7iGI/qA1XhClXouO8GcjRT3VqcTOEcs+kMrbw85Ggkip/G Hb7aMXtg96dIjqv8XXIDmkofjmKhEcpNapRoSzN6d9MJHvJ7yG7vVKtID/jH216IHJcC wUGrDMvAXDhEfZsUg9HODRGmCJmV/oVruJQrhdnbU1WKyyLv+XvlJjGNymDfOSp4OWa4 20ug==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=IlDQGPkT; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-128261-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-128261-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id hs17-20020a1709073e9100b00a4e801fa0f1si1192792ejc.172.2024.04.02.08.43.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Apr 2024 08:43:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-128261-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=IlDQGPkT; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-128261-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-128261-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 16D7D1F24A7C for ; Tue, 2 Apr 2024 15:43:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 04900131E3A; Tue, 2 Apr 2024 15:42:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="IlDQGPkT" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.11]) (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 6820D134730; Tue, 2 Apr 2024 15:42:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.11 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712072550; cv=none; b=bMm7MpWU1HLeH/iLk1yelBtc6d0Ok7YhE2SV7T3fbIBi7Eyn6wAfn+UpZOBhlx8sfpN4HCFzSrzau8ddbZDnKnWgrn0Ps8ZinubrJA8kFzpsZEWP5TGlXOQMykrWT3EwSsPet3nTdC9uZS86yAveN9MmKDDPIMD5AeZpzXEF9Js= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712072550; c=relaxed/simple; bh=LcqZFh6/V3ILmvm1KWfU5KvKxMmRC9e8E1vyzCpbkO0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=hXD/uN09h88CWjJ0Cx+fT9azkKlieOZ857d3T4+7JD6RCdwnfo5pdm7upSJJWaTBBkmFWzpXNJCFJE7L6rOK2uAd7aZLEWdv+mU9tJ4UP+jmzFl5QpldZejc8CdR57oe9pjf4rbvEKbt3X1N/P17aA16TJc9ofHeLni9FMzVpiI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=IlDQGPkT; arc=none smtp.client-ip=192.198.163.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1712072549; x=1743608549; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=LcqZFh6/V3ILmvm1KWfU5KvKxMmRC9e8E1vyzCpbkO0=; b=IlDQGPkTnFbN7FS3YRRXNOGsjVhdUVACNa7R9UAVeoTWeFQh0yTx5vN5 f5+ej/h3uIvzMEHUEeD2Le8tt93mjkd7s7IeWoHdtZf5w1WoDDKg43L39 R8f06Vuz3pqZKCQ9CXTWlenOcxOpMJu7iKReMv270VcKb+yCvKGQCwQ6I OXj1OnhIicAVBGWqCwfjH7o49ZjzHCoDpWpgjqDeFfAixL+gl0A35aLm2 JTS/SSDIkowtxzUVYYi+Db1p77BcvBpStWsJABVeez9yamYeWSxS1ZV3N qiFlu/Bg9Zf3VcbLifo8d0aJPJI6pd3EJL5FaS9T4TLAaybvP/OmrhuC4 w==; X-CSE-ConnectionGUID: 2TuxaaalQnek3TFHY3LrrA== X-CSE-MsgGUID: pjcKM7UrSoudoVEyiC0k2A== X-IronPort-AV: E=McAfee;i="6600,9927,11032"; a="17870072" X-IronPort-AV: E=Sophos;i="6.07,175,1708416000"; d="scan'208";a="17870072" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmvoesa105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Apr 2024 08:42:25 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,11032"; a="937083644" X-IronPort-AV: E=Sophos;i="6.07,175,1708416000"; d="scan'208";a="937083644" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga001.fm.intel.com with ESMTP; 02 Apr 2024 08:42:23 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id A367B1506; Tue, 2 Apr 2024 18:42:20 +0300 (EEST) From: Andy Shevchenko To: Greg Kroah-Hartman , Andy Shevchenko , linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org Cc: Jiri Slaby Subject: [PATCH v1 10/16] serial: max3100: Switch to use dev_err_probe() Date: Tue, 2 Apr 2024 18:38:16 +0300 Message-ID: <20240402154219.3583679-11-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1.gbec44491f096 In-Reply-To: <20240402154219.3583679-1-andriy.shevchenko@linux.intel.com> References: <20240402154219.3583679-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Switch to use dev_err_probe() to simplify the error path and unify a message template. Signed-off-by: Andy Shevchenko --- drivers/tty/serial/max3100.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/drivers/tty/serial/max3100.c b/drivers/tty/serial/max3100.c index e7963382bbb6..c4e4dc5f0858 100644 --- a/drivers/tty/serial/max3100.c +++ b/drivers/tty/serial/max3100.c @@ -719,9 +719,8 @@ static int max3100_probe(struct spi_device *spi) uart_driver_registered = 1; retval = uart_register_driver(&max3100_uart_driver); if (retval) { - printk(KERN_ERR "Couldn't register max3100 uart driver\n"); mutex_unlock(&max3100s_lock); - return retval; + return dev_err_probe(dev, retval, "Couldn't register max3100 uart driver\n"); } } @@ -729,15 +728,12 @@ static int max3100_probe(struct spi_device *spi) if (!max3100s[i]) break; if (i == MAX_MAX3100) { - dev_warn(&spi->dev, "too many MAX3100 chips\n"); mutex_unlock(&max3100s_lock); - return -ENOMEM; + return dev_err_probe(dev, -ENOMEM, "too many MAX3100 chips\n"); } max3100s[i] = kzalloc(sizeof(struct max3100_port), GFP_KERNEL); if (!max3100s[i]) { - dev_warn(&spi->dev, - "kmalloc for max3100 structure %d failed!\n", i); mutex_unlock(&max3100s_lock); return -ENOMEM; } @@ -761,9 +757,7 @@ static int max3100_probe(struct spi_device *spi) retval = uart_add_one_port(&max3100_uart_driver, &max3100s[i]->port); if (retval < 0) - dev_warn(&spi->dev, - "uart_add_one_port failed for line %d with error %d\n", - i, retval); + dev_err_probe(dev, retval, "uart_add_one_port failed for line %d\n", i); /* set shutdown mode to save power. Will be woken-up on open */ max3100_sr(max3100s[i], MAX3100_WC | MAX3100_SHDN, &rx); -- 2.43.0.rc1.1.gbec44491f096