Received: by 2002:ab2:60d1:0:b0:1f7:5705:b850 with SMTP id i17csp1194100lqm; Thu, 2 May 2024 07:49:11 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWox/0w584udds1vldxD7q0Nx0JPhGLg1fFTe3Hmfnd+ggsL+PFVzlMKSrnBBR/5LNEH36HCcOTPvn7bEhZ4OFYDcZzFGLljsZGMJnwDg== X-Google-Smtp-Source: AGHT+IFQExfHZuDBobCtNix+XSJrVyQjfjsLMi9aw69BJeN/nvMaOMcJ41BIxwsAAM5lrASHy6YF X-Received: by 2002:ad4:5967:0:b0:6a0:d291:a35e with SMTP id eq7-20020ad45967000000b006a0d291a35emr6190432qvb.52.1714661351031; Thu, 02 May 2024 07:49:11 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714661351; cv=pass; d=google.com; s=arc-20160816; b=I1BIOpDFbm6c6PV7VidjLPAViBRoX68T0tYN82PVGwkYiKfOu8/UARGRqzYXZG680t ne9sDL01qIq8kBl28yqXgNSw5+4edYZnFIvLnqLmUBhPDBtkvwxu4J9LFacf/cK6pa5v pxQNhPoxA6+SY/5KZkTVcdbmAz3rs7DLXXmP1aOy3H+od4QPK8BpCnVglYW3ADgoGbC7 LTCTDDMA/dwZ5ylbGtCi1xcw5znQ3AdELMm36WxIPW/4hqsyjjla3mj4Ijf2onZVfdRx h44npOw/PVuKuO0mlY190BjyqjIBWEVOVVnapJXF1vtndao+dl/SXdxxirCZYEV1RDAz PyAw== 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=Y8G2uJrC9raEokVt5GnMzRoV12haNiMS5a+UgWCzHo0=; fh=iJf5csy0r5ybD7NaLRHWR20RoYCcjF+JTLc5MGZ+RdE=; b=ogMCVgGTMsFn8F6LS5UcIt+Ll5c4noWcQd6uKvaDuAASBlecf/Ioz+M3oKNSBAgXzE qLncWxjDbFjvVQaskGwNc4sE9agolAKu4r6Ja/Jwsy2xjSKrhjzfPJu/4RIoPBsxalC9 1llPHlRJ99ASJYjYyTH3CnWuvWrhcz1zSeq8QDrY0Vdwba227oU/se0FNHWLatlzKANz y9czjtnHDCfglvI58tXa3F20Yz09SqirGGsJY9EEKZTIQz80RTGTmEpGDT9x4I9kUWLy 4Jglu/yeO2vCt+gRnmj3zw53pxSqjjQPJx6andM78Nqqv2eCDSP4I3Y3JLciaeJiUxOP HKHg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=PvmcOPeO; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-166592-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-166592-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id d7-20020a05621421c700b006a0ad56391asi1117422qvh.411.2024.05.02.07.49.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 May 2024 07:49:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-166592-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=PvmcOPeO; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-166592-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-166592-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 9FA9B1C22B1F for ; Thu, 2 May 2024 14:49:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CD27015CD68; Thu, 2 May 2024 14:46:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="PvmcOPeO" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.19]) (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 DDFAF1591F6; Thu, 2 May 2024 14:46:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.19 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714661205; cv=none; b=pLYeb1VD9EL890ReRJ1rIfspUjyWzjMpwleOZ/VYDDlp0bcRm4SxOrp+KiydKt/Ry0WhVx63zJ2YaJHgjPYo6t75KatBJIDtC/t5AoPWpj/Bvvl93Ig+ywV0IFevBO3iwpT6nMvYxUqti6mh6eleuMFZSIYOyY93ViGp6Xmlyf4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714661205; c=relaxed/simple; bh=HSPO3BYYrHNKLlywx1qmFZnk+RVxu/4s6sl1HAdCBHQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rRLKHSjYOHdq0CVAkwNmcC3dAcLktgbIX0bi3sdaO+Spl8UspdsuwHMANrWPZvmAoQldLbhJ/Y9Hbuv8dfghov8BVsjw20hNM/siCVW498vXtGSDF9oQjh8q4FN/TAritNOPYs+KGEnfYyQlGxn8BmbrnVmyCGE7txTVFUuNOE8= 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=PvmcOPeO; arc=none smtp.client-ip=192.198.163.19 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=1714661204; x=1746197204; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=HSPO3BYYrHNKLlywx1qmFZnk+RVxu/4s6sl1HAdCBHQ=; b=PvmcOPeOuJ8nduja8qSHFdp4c/KDnRTWIUov+H/c+NcdYzxFSW/womri OJqKMb2xwkvCLnhWLXGWbyIZjQ+aDaFV8paV8gpfsiCbwGWd6Drf9mIjN 89A7/c0RcBXWyPajiUwnWZPI4c1vZzFTooqgYrtlb+oh62QONCC3S7vL+ Eeavd9ZLbhxUrOnNF2y53YnrDoK8hMnpwd8IahmzHXXvkUIAuhjMM7rmC LyZewBANcEHGXoLqXqsYiWADrGtH1A8rySr6mNSG7NQQJAUiBKfHIpL85 yWR+/yMcleVkuFSYTtrljYPB6p7DYh8tI0h7k4u5qrAcKSrYbvLJaK5qA w==; X-CSE-ConnectionGUID: Dc1aEHjWRB+VBRE9xKuk6Q== X-CSE-MsgGUID: 3MMmZuRjTk6pKM4K9sRLRA== X-IronPort-AV: E=McAfee;i="6600,9927,11062"; a="10306108" X-IronPort-AV: E=Sophos;i="6.07,247,1708416000"; d="scan'208";a="10306108" Received: from fmviesa003.fm.intel.com ([10.60.135.143]) by fmvoesa113.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 May 2024 07:46:36 -0700 X-CSE-ConnectionGUID: ydObUywyQCS8i0iX4ZKWng== X-CSE-MsgGUID: HDeGRwNCR4Wbj1bmJdvCJg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,247,1708416000"; d="scan'208";a="31632845" Received: from black.fi.intel.com ([10.237.72.28]) by fmviesa003.fm.intel.com with ESMTP; 02 May 2024 07:46:34 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 44F2AC32; Thu, 2 May 2024 17:46:31 +0300 (EEST) From: Andy Shevchenko To: Parker Newman , Andy Shevchenko , linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org Cc: Greg Kroah-Hartman , Jiri Slaby Subject: [PATCH v1 10/13] serial: 8250_exar: Switch to use dev_err_probe() Date: Thu, 2 May 2024 17:44:04 +0300 Message-ID: <20240502144626.2716994-11-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20240502144626.2716994-1-andriy.shevchenko@linux.intel.com> References: <20240502144626.2716994-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/8250/8250_exar.c | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/drivers/tty/serial/8250/8250_exar.c b/drivers/tty/serial/8250/8250_exar.c index 51f6af16c557..306bc6d7c141 100644 --- a/drivers/tty/serial/8250/8250_exar.c +++ b/drivers/tty/serial/8250/8250_exar.c @@ -889,11 +889,8 @@ static int cti_port_setup_common(struct exar8250 *priv, port->port.uartclk = priv->osc_freq; ret = serial8250_pci_setup_port(pcidev, port, 0, offset, 0); - if (ret) { - dev_err(&pcidev->dev, - "failed to setup pci for port %d err: %d\n", idx, ret); + if (ret) return ret; - } port->port.private_data = (void *)priv; port->port.pm = exar_pm; @@ -1522,11 +1519,8 @@ exar_pci_probe(struct pci_dev *pcidev, const struct pci_device_id *ent) maxnr = pci_resource_len(pcidev, bar) >> (board->reg_shift + 3); nr_ports = exar_get_nr_ports(board, pcidev); - if (nr_ports == 0) { - dev_err_probe(&pcidev->dev, -ENODEV, - "failed to get number of ports\n"); - return -ENODEV; - } + if (nr_ports == 0) + return dev_err_probe(&pcidev->dev, -ENODEV, "failed to get number of ports\n"); priv = devm_kzalloc(&pcidev->dev, struct_size(priv, line, nr_ports), GFP_KERNEL); if (!priv) @@ -1559,7 +1553,7 @@ exar_pci_probe(struct pci_dev *pcidev, const struct pci_device_id *ent) for (i = 0; i < nr_ports && i < maxnr; i++) { rc = board->setup(priv, pcidev, &uart, i); if (rc) { - dev_err(&pcidev->dev, "Failed to setup port %u\n", i); + dev_err_probe(&pcidev->dev, rc, "Failed to setup port %u\n", i); break; } @@ -1568,10 +1562,9 @@ exar_pci_probe(struct pci_dev *pcidev, const struct pci_device_id *ent) priv->line[i] = serial8250_register_8250_port(&uart); if (priv->line[i] < 0) { - dev_err(&pcidev->dev, - "Couldn't register serial port %lx, irq %d, type %d, error %d\n", - uart.port.iobase, uart.port.irq, - uart.port.iotype, priv->line[i]); + dev_err_probe(&pcidev->dev, priv->line[i], + "Couldn't register serial port %lx, type %d, irq %d\n", + uart.port.iobase, uart.port.iotype, uart.port.irq); break; } } -- 2.43.0.rc1.1336.g36b5255a03ac