From patchwork Mon Mar 6 18:31:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 660415 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9D91EC64EC4 for ; Mon, 6 Mar 2023 18:30:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229865AbjCFSak (ORCPT ); Mon, 6 Mar 2023 13:30:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54738 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229790AbjCFSak (ORCPT ); Mon, 6 Mar 2023 13:30:40 -0500 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 104A530195; Mon, 6 Mar 2023 10:30:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1678127439; x=1709663439; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=SzDNxv/R8pxYIbdy4sFf5lgkB072RjOTFq/X3ZPzELA=; b=VZvs11m4tIt75iNGgZMH4odbY0PE5+tGbTYy7aJUR95xEVD0OZF5MHw5 BRdkea3aN/8BHpoNn+eEe7BmJsQHAo/DFXya4z1duT0PTijMBCOu8g3qa ko07r39mBWJL6CGdFhJ94zFLCbkN+U5Zi5Z8WOBqLGMbPpNkSLWuAfIsr OMcCWSYbvAsK4pbbeqFDECZVR7GjXNOmhB3I01IyEwZoCjBwAwDe729xb rA33ltoAqAc0+G5kksr1okcVLvV7BZEN9Yl1QexmONBpLC0BZB4LB1G2i rv6IrVIvWqamRs21lSnfPHDmVQsxLxVo5+XkO7NzX+S1EC8y+B8Z5xquw A==; X-IronPort-AV: E=McAfee;i="6500,9779,10641"; a="363257686" X-IronPort-AV: E=Sophos;i="5.98,238,1673942400"; d="scan'208";a="363257686" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Mar 2023 10:30:38 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10641"; a="786348696" X-IronPort-AV: E=Sophos;i="5.98,238,1673942400"; d="scan'208";a="786348696" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga002.fm.intel.com with ESMTP; 06 Mar 2023 10:30:36 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 54D0387; Mon, 6 Mar 2023 20:31:19 +0200 (EET) From: Andy Shevchenko To: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Mark Brown , Rob Herring , Andy Shevchenko Subject: [PATCH v1 1/5] spi: mpc5xxx-psc: Correct error check for devm_platform_get_and_ioremap_resource() Date: Mon, 6 Mar 2023 20:31:11 +0200 Message-Id: <20230306183115.87314-2-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230306183115.87314-1-andriy.shevchenko@linux.intel.com> References: <20230306183115.87314-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org devm_platform_get_and_ioremap_resource() may return pointer or error pointer, never the NULL. Correct error check for it. Fixes: 60a6c8257f41 ("spi: mpc5xxx-psc: Use platform resources instead of parsing DT properties") Signed-off-by: Andy Shevchenko --- drivers/spi/spi-mpc512x-psc.c | 4 ++-- drivers/spi/spi-mpc52xx-psc.c | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-mpc512x-psc.c b/drivers/spi/spi-mpc512x-psc.c index 5bdfe4a740e9..a2ea24a63cb4 100644 --- a/drivers/spi/spi-mpc512x-psc.c +++ b/drivers/spi/spi-mpc512x-psc.c @@ -483,8 +483,8 @@ static int mpc512x_psc_spi_of_probe(struct platform_device *pdev) master->dev.of_node = dev->of_node; tempp = devm_platform_get_and_ioremap_resource(pdev, 0, NULL); - if (!tempp) - return dev_err_probe(dev, -EFAULT, "could not ioremap I/O port range\n"); + if (IS_ERR(tempp)) + return dev_err_probe(dev, PTR_ERR(tempp), "could not ioremap I/O port range\n"); mps->psc = tempp; mps->fifo = (struct mpc512x_psc_fifo *)(tempp + sizeof(struct mpc52xx_psc)); diff --git a/drivers/spi/spi-mpc52xx-psc.c b/drivers/spi/spi-mpc52xx-psc.c index 95a4a511c388..1bf728f4d766 100644 --- a/drivers/spi/spi-mpc52xx-psc.c +++ b/drivers/spi/spi-mpc52xx-psc.c @@ -321,8 +321,9 @@ static int mpc52xx_psc_spi_of_probe(struct platform_device *pdev) master->dev.of_node = dev->of_node; mps->psc = devm_platform_get_and_ioremap_resource(pdev, 0, NULL); - if (!mps->psc) - return dev_err_probe(dev, -EFAULT, "could not ioremap I/O port range\n"); + if (IS_ERR(mps->psc)) + return dev_err_probe(dev, PTR_ERR(mps->psc), "could not ioremap I/O port range\n"); + /* On the 5200, fifo regs are immediately ajacent to the psc regs */ mps->fifo = ((void __iomem *)mps->psc) + sizeof(struct mpc52xx_psc); From patchwork Mon Mar 6 18:31:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 660416 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2E764C61DA4 for ; Mon, 6 Mar 2023 18:30:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229579AbjCFSak (ORCPT ); Mon, 6 Mar 2023 13:30:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54732 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229718AbjCFSaj (ORCPT ); Mon, 6 Mar 2023 13:30:39 -0500 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 06E88170F; Mon, 6 Mar 2023 10:30:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1678127439; x=1709663439; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=VvQq/hiW3ciMZLoERkUkYzqWpN07fmrNja7l175IvIY=; b=L8h8F49OtVGAMTSjKU6Xd0Rb5fbsnW8wV1Qeaps6DbG6LXTzJ2Cf990F D+OzjSYIebSUghZ7OKxnazoOsPfo96boW0u39HCxF9Eka6HuobGxy1gGT QXMTUWQxcLGlO+hxS1l4WYFKPhPUCedds6x/KewDLLfT6zSM+skelAkyg 5LukkjHppCH6ViWnlYSQT48bMENrLu6qOKvEQf8xYqH6q4vP0sVI/XFLQ drTtfCrWj7efefNUXBWivJSNVOWd6ZJuXuuysbvn5vgsc3qXCnkebRmt1 U9ZwXbWs14Vo+8oarCQF4Eir7KW2SE836FGEvxMYH07A4TyW9UT6pATMz Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10641"; a="333109220" X-IronPort-AV: E=Sophos;i="5.98,238,1673942400"; d="scan'208";a="333109220" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Mar 2023 10:30:37 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10641"; a="669559042" X-IronPort-AV: E=Sophos;i="5.98,238,1673942400"; d="scan'208";a="669559042" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga007.jf.intel.com with ESMTP; 06 Mar 2023 10:30:36 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 5E83C14F; Mon, 6 Mar 2023 20:31:19 +0200 (EET) From: Andy Shevchenko To: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Mark Brown , Rob Herring , Andy Shevchenko Subject: [PATCH v1 2/5] spi: mpc5xxx-psc: Return immediately if IRQ resource is unavailable Date: Mon, 6 Mar 2023 20:31:12 +0200 Message-Id: <20230306183115.87314-3-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230306183115.87314-1-andriy.shevchenko@linux.intel.com> References: <20230306183115.87314-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org Return immediately if IRQ resource is unavailable. This will also propagate the correct error code in such cases. Signed-off-by: Andy Shevchenko --- drivers/spi/spi-mpc512x-psc.c | 3 +++ drivers/spi/spi-mpc52xx-psc.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/drivers/spi/spi-mpc512x-psc.c b/drivers/spi/spi-mpc512x-psc.c index a2ea24a63cb4..8a436d1906eb 100644 --- a/drivers/spi/spi-mpc512x-psc.c +++ b/drivers/spi/spi-mpc512x-psc.c @@ -490,6 +490,9 @@ static int mpc512x_psc_spi_of_probe(struct platform_device *pdev) (struct mpc512x_psc_fifo *)(tempp + sizeof(struct mpc52xx_psc)); mps->irq = platform_get_irq(pdev, 0); + if (mps->irq < 0) + return mps->irq; + ret = devm_request_irq(dev, mps->irq, mpc512x_psc_spi_isr, IRQF_SHARED, "mpc512x-psc-spi", mps); if (ret) diff --git a/drivers/spi/spi-mpc52xx-psc.c b/drivers/spi/spi-mpc52xx-psc.c index 1bf728f4d766..b75bc2457883 100644 --- a/drivers/spi/spi-mpc52xx-psc.c +++ b/drivers/spi/spi-mpc52xx-psc.c @@ -328,6 +328,9 @@ static int mpc52xx_psc_spi_of_probe(struct platform_device *pdev) mps->fifo = ((void __iomem *)mps->psc) + sizeof(struct mpc52xx_psc); mps->irq = platform_get_irq(pdev, 0); + if (mps->irq < 0) + return mps->irq; + ret = devm_request_irq(dev, mps->irq, mpc52xx_psc_spi_isr, 0, "mpc52xx-psc-spi", mps); if (ret) From patchwork Mon Mar 6 18:31:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 659679 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 60A32C6FD1B for ; Mon, 6 Mar 2023 18:30:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230086AbjCFSal (ORCPT ); Mon, 6 Mar 2023 13:30:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54756 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229812AbjCFSak (ORCPT ); Mon, 6 Mar 2023 13:30:40 -0500 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C38A8301B1; Mon, 6 Mar 2023 10:30:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1678127439; x=1709663439; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=JPcoNFmGiGsUtQhMFEvvIYMF9pcbCxGWNO7kulXjTb8=; b=aSvqLyRk71r2sJ6t7kut+GYRtZY5OUqQCLQFdVYw+++yfbVTfC/lIe1p tlW1ekO7kVwdFnistDQZJ7/j6HBUsD5YxcFxZsO4xkwmerp4aj1+m8iJu NBJxCodcsvW73TIyuyMqFNWf3lbqLmnyuZgs09aK9D+v032vR3C8Bjh2y l0swk32RSABE4BfDAvUlH+eKEKpk1nZeN7QnmoW81oCbXbfL5On0QHn8i nHTwwAHOYiWis5A0PbwTxUF1tJxtcANHr/c/Y8AVERWJOswsB0PB2hlNX AHHJ1MT2raJePuK3AZV/bqX5SJy87LtNctF63zH6r6e5r9S05Dzbw741c Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10641"; a="333109225" X-IronPort-AV: E=Sophos;i="5.98,238,1673942400"; d="scan'208";a="333109225" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Mar 2023 10:30:38 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10641"; a="669559043" X-IronPort-AV: E=Sophos;i="5.98,238,1673942400"; d="scan'208";a="669559043" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga007.jf.intel.com with ESMTP; 06 Mar 2023 10:30:36 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 76B25354; Mon, 6 Mar 2023 20:31:19 +0200 (EET) From: Andy Shevchenko To: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Mark Brown , Rob Herring , Andy Shevchenko Subject: [PATCH v1 3/5] spi: mpc5xxx-psc: use devm_clk_get_enabled() for core clock Date: Mon, 6 Mar 2023 20:31:13 +0200 Message-Id: <20230306183115.87314-4-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230306183115.87314-1-andriy.shevchenko@linux.intel.com> References: <20230306183115.87314-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org Use devm_clk_get_enabled() to simplify the code. Signed-off-by: Andy Shevchenko --- drivers/spi/spi-mpc512x-psc.c | 39 ++++------------------------------- 1 file changed, 4 insertions(+), 35 deletions(-) diff --git a/drivers/spi/spi-mpc512x-psc.c b/drivers/spi/spi-mpc512x-psc.c index 8a436d1906eb..739df2b241e9 100644 --- a/drivers/spi/spi-mpc512x-psc.c +++ b/drivers/spi/spi-mpc512x-psc.c @@ -54,8 +54,6 @@ struct mpc512x_psc_spi { struct mpc512x_psc_fifo __iomem *fifo; unsigned int irq; u8 bits_per_word; - struct clk *clk_mclk; - struct clk *clk_ipg; u32 mclk_rate; struct completion txisrdone; @@ -499,25 +497,15 @@ static int mpc512x_psc_spi_of_probe(struct platform_device *pdev) return ret; init_completion(&mps->txisrdone); - clk = devm_clk_get(dev, "mclk"); + clk = devm_clk_get_enabled(dev, "mclk"); if (IS_ERR(clk)) return PTR_ERR(clk); - ret = clk_prepare_enable(clk); - if (ret) - return ret; - mps->clk_mclk = clk; mps->mclk_rate = clk_get_rate(clk); - clk = devm_clk_get(dev, "ipg"); - if (IS_ERR(clk)) { - ret = PTR_ERR(clk); - goto free_mclk_clock; - } - ret = clk_prepare_enable(clk); - if (ret) - goto free_mclk_clock; - mps->clk_ipg = clk; + clk = devm_clk_get_enabled(dev, "ipg"); + if (IS_ERR(clk)) + return PTR_ERR(clk); ret = mpc512x_psc_spi_port_config(master, mps); if (ret < 0) @@ -528,24 +516,6 @@ static int mpc512x_psc_spi_of_probe(struct platform_device *pdev) goto free_ipg_clock; return ret; - -free_ipg_clock: - clk_disable_unprepare(mps->clk_ipg); -free_mclk_clock: - clk_disable_unprepare(mps->clk_mclk); - - return ret; -} - -static int mpc512x_psc_spi_of_remove(struct platform_device *pdev) -{ - struct spi_master *master = dev_get_drvdata(&pdev->dev); - struct mpc512x_psc_spi *mps = spi_master_get_devdata(master); - - clk_disable_unprepare(mps->clk_mclk); - clk_disable_unprepare(mps->clk_ipg); - - return 0; } static const struct of_device_id mpc512x_psc_spi_of_match[] = { @@ -558,7 +528,6 @@ MODULE_DEVICE_TABLE(of, mpc512x_psc_spi_of_match); static struct platform_driver mpc512x_psc_spi_of_driver = { .probe = mpc512x_psc_spi_of_probe, - .remove = mpc512x_psc_spi_of_remove, .driver = { .name = "mpc512x-psc-spi", .of_match_table = mpc512x_psc_spi_of_match, From patchwork Mon Mar 6 18:31:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 660414 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 33C5DC6FD1D for ; Mon, 6 Mar 2023 18:30:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230054AbjCFSan (ORCPT ); Mon, 6 Mar 2023 13:30:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54770 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230005AbjCFSal (ORCPT ); Mon, 6 Mar 2023 13:30:41 -0500 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0F087BBA7; Mon, 6 Mar 2023 10:30:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1678127440; x=1709663440; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=4ozgUwrnazel/IFh5JrjS3Sz/LmjOqA6oCX8ytuPDBQ=; b=cqCrG/vJBhLJ4ABLNn8WjTPsHEnMY35/CKdd7+ezFZHHLHM6cO4TVGEC qbSs7X07Can4UMzhMtwykDgdrNnf70RdSDlX+w4lyxkUTEGvh3xPN7jY7 Dp74/hCHVzuSI5xiVSYRPY8HOXXl+eZZpLKkQ7FZONEiO4f/J7MCsIxUe wGSgfwt9ow4II2iSvKW3ne0WmkoYukf8GGAjTTqtxXFi+vFnBVu76ea1z Xi8I22RL7jL+SlIzGDE3vhxnoarRVtqtp3MyA7BftorhLx//OewMZri5b JXZT6HF6qfupg8+/LLs/BU9+ssGYVqIPI8cETVik8YjXm3D4ltwW5hSNt w==; X-IronPort-AV: E=McAfee;i="6500,9779,10641"; a="363257692" X-IronPort-AV: E=Sophos;i="5.98,238,1673942400"; d="scan'208";a="363257692" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Mar 2023 10:30:38 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10641"; a="786348695" X-IronPort-AV: E=Sophos;i="5.98,238,1673942400"; d="scan'208";a="786348695" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga002.fm.intel.com with ESMTP; 06 Mar 2023 10:30:36 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 7C4F7154; Mon, 6 Mar 2023 20:31:19 +0200 (EET) From: Andy Shevchenko To: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Mark Brown , Rob Herring , Andy Shevchenko Subject: [PATCH v1 4/5] spi: mpc5xxx-psc: Propagate firmware node Date: Mon, 6 Mar 2023 20:31:14 +0200 Message-Id: <20230306183115.87314-5-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230306183115.87314-1-andriy.shevchenko@linux.intel.com> References: <20230306183115.87314-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org Propagate firmware node by using a specific API call, i.e. device_set_node(). Signed-off-by: Andy Shevchenko --- drivers/spi/spi-mpc512x-psc.c | 4 +++- drivers/spi/spi-mpc52xx-psc.c | 5 +++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/spi/spi-mpc512x-psc.c b/drivers/spi/spi-mpc512x-psc.c index 739df2b241e9..77a228f633d1 100644 --- a/drivers/spi/spi-mpc512x-psc.c +++ b/drivers/spi/spi-mpc512x-psc.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -478,7 +479,8 @@ static int mpc512x_psc_spi_of_probe(struct platform_device *pdev) master->unprepare_transfer_hardware = mpc512x_psc_spi_unprep_xfer_hw; master->use_gpio_descriptors = true; master->cleanup = mpc512x_psc_spi_cleanup; - master->dev.of_node = dev->of_node; + + device_set_node(&master->dev, dev_fwnode(dev)); tempp = devm_platform_get_and_ioremap_resource(pdev, 0, NULL); if (IS_ERR(tempp)) diff --git a/drivers/spi/spi-mpc52xx-psc.c b/drivers/spi/spi-mpc52xx-psc.c index b75bc2457883..335a6b9eb141 100644 --- a/drivers/spi/spi-mpc52xx-psc.c +++ b/drivers/spi/spi-mpc52xx-psc.c @@ -11,8 +11,8 @@ #include #include #include -#include #include +#include #include #include #include @@ -318,7 +318,8 @@ static int mpc52xx_psc_spi_of_probe(struct platform_device *pdev) master->setup = mpc52xx_psc_spi_setup; master->transfer_one_message = mpc52xx_psc_spi_transfer_one_message; master->cleanup = mpc52xx_psc_spi_cleanup; - master->dev.of_node = dev->of_node; + + device_set_node(&master->dev, dev_fwnode(dev)); mps->psc = devm_platform_get_and_ioremap_resource(pdev, 0, NULL); if (IS_ERR(mps->psc)) From patchwork Mon Mar 6 18:31:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 659678 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7C6EDC6FD1F for ; Mon, 6 Mar 2023 18:30:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230206AbjCFSao (ORCPT ); Mon, 6 Mar 2023 13:30:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54778 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230107AbjCFSal (ORCPT ); Mon, 6 Mar 2023 13:30:41 -0500 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F3E7E32CE1; Mon, 6 Mar 2023 10:30:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1678127441; x=1709663441; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=fquPdIobgt4dFtH9WXP11i+KlpBlpDxDrJNJpLKK+xU=; b=JISjJtUhW7ju62DxeEmyVaFPDrBvtAynfTV+CIfHlbSWxAuBVnzgulG0 7Yu3EmSAP1QaA4R200ZtqAh1uQrd3kafDg2FbKZWvOyzMkhU/0pbDdsZZ /lNPcg1wGg1Ez6JgbSYS35Wos8muKkJDOy1e86yC6wYGAeH7+8aV6uUWF xwsY+K/IWo0m7Ad35q98BrRgjVHxouy3D3c0fAGSBWmJRpv5enJ9u2nbW 5ktryAGsXS9xZzK6I/iAYRfvUJ3U40GQMfLL0fMSCdMWA2T1ZKnrQygUO 4lMMYnfvqiWe0CeSioOA9y1qGDoCdfgkCWSucj+fLQeRdyei2gVRcTxiS w==; X-IronPort-AV: E=McAfee;i="6500,9779,10641"; a="363257720" X-IronPort-AV: E=Sophos;i="5.98,238,1673942400"; d="scan'208";a="363257720" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Mar 2023 10:30:40 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10641"; a="786348766" X-IronPort-AV: E=Sophos;i="5.98,238,1673942400"; d="scan'208";a="786348766" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga002.fm.intel.com with ESMTP; 06 Mar 2023 10:30:38 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 8B6FF398; Mon, 6 Mar 2023 20:31:19 +0200 (EET) From: Andy Shevchenko To: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Mark Brown , Rob Herring , Andy Shevchenko Subject: [PATCH v1 5/5] spi: mpc5xxx-psc: Consistently use device property APIs Date: Mon, 6 Mar 2023 20:31:15 +0200 Message-Id: <20230306183115.87314-6-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230306183115.87314-1-andriy.shevchenko@linux.intel.com> References: <20230306183115.87314-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org Instead of calling the OF APIs mixed with device property APIs, just switch to use the latter everywhere. Signed-off-by: Andy Shevchenko --- drivers/spi/spi-mpc52xx-psc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/spi/spi-mpc52xx-psc.c b/drivers/spi/spi-mpc52xx-psc.c index 335a6b9eb141..9a1a080fb688 100644 --- a/drivers/spi/spi-mpc52xx-psc.c +++ b/drivers/spi/spi-mpc52xx-psc.c @@ -309,7 +309,7 @@ static int mpc52xx_psc_spi_of_probe(struct platform_device *pdev) /* the spi->mode bits understood by this driver: */ master->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH | SPI_LSB_FIRST; - ret = of_property_read_u32(dev->of_node, "cell-index", &bus_num); + ret = device_property_read_u32(dev, "cell-index", &bus_num); if (ret || bus_num > 5) return dev_err_probe(dev, ret ? : -EINVAL, "Invalid cell-index property\n"); master->bus_num = bus_num + 1;