From patchwork Tue Mar 26 18:07:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13604822 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 650EEC54E67 for ; Tue, 26 Mar 2024 18:11:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=hx9d6yO3Wm++FCUCtEBNKM/JM+aj0ApTGe6BPYWdkFA=; b=uC7iuxR7C9mOiH Do4oXzGXtGk/M8+tZ6oo3WvduBRcE1TWfuVPF/V9qk6xNoCK6OMmexz/GZhQPKYfDpQT4xgzL479v liVQTyJ8ykFqsrQ8/C3N1h9Qx9vpBLPshcYYa4WShyQDimp57MakClnre5B0i9K12+Gl48KIEuVvk ZC1mjoRXawYsaMoXyLNrlIzcMk3PEWLmwXZ96Y24UTWslomfAv7rkMI1xwMw1aDGzMYmjUN0SFd4c MFBPfwXcsnVOEvCnQVfHdYbYfxJu0K97QB30LBg2egz77MzYwn8HbfoG2lSWZZCgU0JNN9xm34hUa e1F9SQiRdHCQstvhzE0w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rpBGA-00000005sX7-1tT7; Tue, 26 Mar 2024 18:10:54 +0000 Received: from mgamail.intel.com ([192.198.163.12]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rpBFx-00000005sPZ-3xpD for linux-arm-kernel@lists.infradead.org; Tue, 26 Mar 2024 18:10:44 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1711476642; x=1743012642; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Oh3MUbUj1XxFveo7rtHk0ivojd56U90Z0wqM4ju1lRM=; b=EnZC8Y5Xtbyed6Yse0+M3sH9RFoFHIimr2Cse8titG6rLKsh/8tKy8wf eW7CSsY2vmD9lHroEqKZXmlw7nr400x1DCBL7jtecRxSLggNCe5yDv+x5 Xbjkzs27iN9rsnyhk5Mhx6kvjrfgNvG2EUS1yIlQwyNvnQG2uARVGEi27 yAAC9aW3Ve7sEvvcASatiRYMXvtkAQ6LOq4AixVPrpzUbzR50hffXGwTL 3vB5jLuqc4B9jjqc92xJuMjYeUlkSf6MkBi0p2LAC67x95deBllhulIpu fhcicP9CgCPpC8DlYZVa4KMHD9/dcH6YIJqjup2rQ9Z81SUIxSMp6cFwh w==; X-CSE-ConnectionGUID: uRC/42KOS92xBb9BaWUn0A== X-CSE-MsgGUID: i3mUOT00QWq3JWJRgP0fLg== X-IronPort-AV: E=McAfee;i="6600,9927,11025"; a="10325681" X-IronPort-AV: E=Sophos;i="6.07,156,1708416000"; d="scan'208";a="10325681" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmvoesa106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Mar 2024 11:10:38 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,11025"; a="937072938" X-IronPort-AV: E=Sophos;i="6.07,156,1708416000"; d="scan'208";a="937072938" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga001.fm.intel.com with ESMTP; 26 Mar 2024 11:10:35 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id E35AA2CA; Tue, 26 Mar 2024 20:10:34 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , Mark Brown , linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Daniel Mack , Haojian Zhuang , Robert Jarzmik , Russell King Subject: [PATCH v1 03/10] spi: pxa2xx: Switch to use dev_err_probe() Date: Tue, 26 Mar 2024 20:07:53 +0200 Message-ID: <20240326181027.1418989-4-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1.gbec44491f096 In-Reply-To: <20240326181027.1418989-1-andriy.shevchenko@linux.intel.com> References: <20240326181027.1418989-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240326_111042_081756_AC951269 X-CRM114-Status: GOOD ( 14.06 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Switch to use dev_err_probe() to simplify the error path and unify a message template. Signed-off-by: Andy Shevchenko --- drivers/spi/spi-pxa2xx.c | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/drivers/spi/spi-pxa2xx.c b/drivers/spi/spi-pxa2xx.c index 2c39d3ff498e..75d208087748 100644 --- a/drivers/spi/spi-pxa2xx.c +++ b/drivers/spi/spi-pxa2xx.c @@ -1434,20 +1434,16 @@ static int pxa2xx_spi_probe(struct platform_device *pdev) platform_info = dev_get_platdata(dev); if (!platform_info) { platform_info = pxa2xx_spi_init_pdata(pdev); - if (IS_ERR(platform_info)) { - dev_err(&pdev->dev, "missing platform data\n"); - return PTR_ERR(platform_info); - } + if (IS_ERR(platform_info)) + return dev_err_probe(dev, PTR_ERR(platform_info), "missing platform data\n"); } ssp = pxa_ssp_request(pdev->id, pdev->name); if (!ssp) ssp = &platform_info->ssp; - if (!ssp->mmio_base) { - dev_err(&pdev->dev, "failed to get SSP\n"); - return -ENODEV; - } + if (!ssp->mmio_base) + return dev_err_probe(dev, -ENODEV, "failed to get SSP\n"); if (platform_info->is_target) controller = devm_spi_alloc_target(dev, sizeof(*drv_data)); @@ -1455,8 +1451,7 @@ static int pxa2xx_spi_probe(struct platform_device *pdev) controller = devm_spi_alloc_host(dev, sizeof(*drv_data)); if (!controller) { - dev_err(&pdev->dev, "cannot alloc spi_controller\n"); - status = -ENOMEM; + status = dev_err_probe(dev, -ENOMEM, "cannot alloc spi_controller\n"); goto out_error_controller_alloc; } drv_data = spi_controller_get_devdata(controller); @@ -1510,7 +1505,7 @@ static int pxa2xx_spi_probe(struct platform_device *pdev) status = request_irq(ssp->irq, ssp_int, IRQF_SHARED, dev_name(dev), drv_data); if (status < 0) { - dev_err(&pdev->dev, "cannot get IRQ %d\n", ssp->irq); + dev_err_probe(dev, status, "cannot get IRQ %d\n", ssp->irq); goto out_error_controller_alloc; } @@ -1626,7 +1621,7 @@ static int pxa2xx_spi_probe(struct platform_device *pdev) platform_set_drvdata(pdev, drv_data); status = spi_register_controller(controller); if (status) { - dev_err(&pdev->dev, "problem registering SPI controller\n"); + dev_err_probe(dev, status, "problem registering SPI controller\n"); goto out_error_pm_runtime_enabled; }