From nobody Wed Jul 1 08:56:42 2026 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 E37B8C4332F for ; Fri, 24 Dec 2021 13:13:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352741AbhLXNNJ (ORCPT ); Fri, 24 Dec 2021 08:13:09 -0500 Received: from relmlor1.renesas.com ([210.160.252.171]:58378 "EHLO relmlie5.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1352728AbhLXNNI (ORCPT ); Fri, 24 Dec 2021 08:13:08 -0500 X-IronPort-AV: E=Sophos;i="5.88,232,1635174000"; d="scan'208";a="104620424" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie5.idc.renesas.com with ESMTP; 24 Dec 2021 22:13:06 +0900 Received: from localhost.localdomain (unknown [10.226.36.204]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 2E68443A180E; Fri, 24 Dec 2021 22:13:05 +0900 (JST) From: Lad Prabhakar To: Damien Le Moal Cc: Sergey Shtylyov , Rob Herring , linux-kernel@vger.kernel.org, Prabhakar , Lad Prabhakar , linux-ide@vger.kernel.org Subject: [PATCH v3 01/10] ata: pata_platform: Make use of platform_get_mem_or_io() Date: Fri, 24 Dec 2021 13:12:50 +0000 Message-Id: <20211224131300.18198-2-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211224131300.18198-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20211224131300.18198-1-prabhakar.mahadev-lad.rj@bp.renesas.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Make use of platform_get_mem_or_io() to simplify the code. Signed-off-by: Lad Prabhakar Reviewed-by: Sergey Shtylyov --- drivers/ata/pata_platform.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/drivers/ata/pata_platform.c b/drivers/ata/pata_platform.c index 028329428b75..cb3134bf88eb 100644 --- a/drivers/ata/pata_platform.c +++ b/drivers/ata/pata_platform.c @@ -198,22 +198,16 @@ static int pata_platform_probe(struct platform_device= *pdev) /* * Get the I/O base first */ - io_res =3D platform_get_resource(pdev, IORESOURCE_IO, 0); - if (io_res =3D=3D NULL) { - io_res =3D platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (unlikely(io_res =3D=3D NULL)) - return -EINVAL; - } + io_res =3D platform_get_mem_or_io(pdev, 0); + if (unlikely(!io_res)) + return -EINVAL; =20 /* * Then the CTL base */ - ctl_res =3D platform_get_resource(pdev, IORESOURCE_IO, 1); - if (ctl_res =3D=3D NULL) { - ctl_res =3D platform_get_resource(pdev, IORESOURCE_MEM, 1); - if (unlikely(ctl_res =3D=3D NULL)) - return -EINVAL; - } + ctl_res =3D platform_get_mem_or_io(pdev, 1); + if (unlikely(!ctl_res)) + return -EINVAL; =20 /* * And the IRQ --=20 2.17.1 From nobody Wed Jul 1 08:56:42 2026 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 9581EC433EF for ; Fri, 24 Dec 2021 13:13:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352758AbhLXNNN (ORCPT ); Fri, 24 Dec 2021 08:13:13 -0500 Received: from relmlor2.renesas.com ([210.160.252.172]:53177 "EHLO relmlie6.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1352735AbhLXNNJ (ORCPT ); Fri, 24 Dec 2021 08:13:09 -0500 X-IronPort-AV: E=Sophos;i="5.88,232,1635174000"; d="scan'208";a="105104958" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie6.idc.renesas.com with ESMTP; 24 Dec 2021 22:13:08 +0900 Received: from localhost.localdomain (unknown [10.226.36.204]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 6E84243A1818; Fri, 24 Dec 2021 22:13:07 +0900 (JST) From: Lad Prabhakar To: Damien Le Moal Cc: Sergey Shtylyov , Rob Herring , linux-kernel@vger.kernel.org, Prabhakar , Lad Prabhakar , linux-ide@vger.kernel.org Subject: [PATCH v3 02/10] ata: pata_platform: Drop use of unlikely() in pata_platform_probe Date: Fri, 24 Dec 2021 13:12:51 +0000 Message-Id: <20211224131300.18198-3-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211224131300.18198-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20211224131300.18198-1-prabhakar.mahadev-lad.rj@bp.renesas.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" pata_platform_probe() isn't a hotpath, which makes it's questionable to use unlikely(). Therefore let's simply drop it. Signed-off-by: Lad Prabhakar --- v2-->v3 * New patch --- drivers/ata/pata_platform.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/ata/pata_platform.c b/drivers/ata/pata_platform.c index cb3134bf88eb..29902001e223 100644 --- a/drivers/ata/pata_platform.c +++ b/drivers/ata/pata_platform.c @@ -199,14 +199,14 @@ static int pata_platform_probe(struct platform_device= *pdev) * Get the I/O base first */ io_res =3D platform_get_mem_or_io(pdev, 0); - if (unlikely(!io_res)) + if (!io_res) return -EINVAL; =20 /* * Then the CTL base */ ctl_res =3D platform_get_mem_or_io(pdev, 1); - if (unlikely(!ctl_res)) + if (!ctl_res) return -EINVAL; =20 /* --=20 2.17.1 From nobody Wed Jul 1 08:56:42 2026 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 BB823C433FE for ; Fri, 24 Dec 2021 13:13:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352772AbhLXNNQ (ORCPT ); Fri, 24 Dec 2021 08:13:16 -0500 Received: from relmlor1.renesas.com ([210.160.252.171]:58378 "EHLO relmlie5.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1352742AbhLXNNL (ORCPT ); Fri, 24 Dec 2021 08:13:11 -0500 X-IronPort-AV: E=Sophos;i="5.88,232,1635174000"; d="scan'208";a="104620428" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie5.idc.renesas.com with ESMTP; 24 Dec 2021 22:13:11 +0900 Received: from localhost.localdomain (unknown [10.226.36.204]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id B47B243A180E; Fri, 24 Dec 2021 22:13:09 +0900 (JST) From: Lad Prabhakar To: Damien Le Moal Cc: Sergey Shtylyov , Rob Herring , linux-kernel@vger.kernel.org, Prabhakar , Lad Prabhakar , linux-ide@vger.kernel.org Subject: [PATCH v3 03/10] ata: pata_of_platform: Use platform_get_irq_optional() to get the interrupt Date: Fri, 24 Dec 2021 13:12:52 +0000 Message-Id: <20211224131300.18198-4-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211224131300.18198-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20211224131300.18198-1-prabhakar.mahadev-lad.rj@bp.renesas.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static allocation of IRQ resources in DT core code, this causes an issue when using hierarchical interrupt domains using "interrupts" property in the node as this bypasses the hierarchical setup and messes up the irq chaining. In preparation for removal of static setup of IRQ resource from DT core code use platform_get_irq_optional(). Signed-off-by: Lad Prabhakar --- v2-->v3 * New patch --- drivers/ata/pata_of_platform.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/drivers/ata/pata_of_platform.c b/drivers/ata/pata_of_platform.c index 35aa158fc976..2e2ec7d77726 100644 --- a/drivers/ata/pata_of_platform.c +++ b/drivers/ata/pata_of_platform.c @@ -25,11 +25,12 @@ static int pata_of_platform_probe(struct platform_devic= e *ofdev) struct device_node *dn =3D ofdev->dev.of_node; struct resource io_res; struct resource ctl_res; - struct resource *irq_res; + struct resource irq_res; unsigned int reg_shift =3D 0; int pio_mode =3D 0; int pio_mask; bool use16bit; + int irq; =20 ret =3D of_address_to_resource(dn, 0, &io_res); if (ret) { @@ -45,7 +46,14 @@ static int pata_of_platform_probe(struct platform_device= *ofdev) return -EINVAL; } =20 - irq_res =3D platform_get_resource(ofdev, IORESOURCE_IRQ, 0); + irq =3D platform_get_irq_optional(ofdev, 0); + if (irq < 0 && irq !=3D -ENXIO) + return irq; + + if (irq > 0) { + memset(&irq_res, 0x0, sizeof(struct resource)); + irq_res.start =3D irq; + } =20 of_property_read_u32(dn, "reg-shift", ®_shift); =20 @@ -63,7 +71,7 @@ static int pata_of_platform_probe(struct platform_device = *ofdev) pio_mask =3D 1 << pio_mode; pio_mask |=3D (1 << pio_mode) - 1; =20 - return __pata_platform_probe(&ofdev->dev, &io_res, &ctl_res, irq_res, + return __pata_platform_probe(&ofdev->dev, &io_res, &ctl_res, irq > 0 ? &i= rq_res : NULL, reg_shift, pio_mask, &pata_platform_sht, use16bit); } --=20 2.17.1 From nobody Wed Jul 1 08:56:42 2026 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 6100BC4332F for ; Fri, 24 Dec 2021 13:13:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352773AbhLXNNT (ORCPT ); Fri, 24 Dec 2021 08:13:19 -0500 Received: from relmlor2.renesas.com ([210.160.252.172]:53177 "EHLO relmlie6.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1352760AbhLXNNO (ORCPT ); Fri, 24 Dec 2021 08:13:14 -0500 X-IronPort-AV: E=Sophos;i="5.88,232,1635174000"; d="scan'208";a="105104961" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie6.idc.renesas.com with ESMTP; 24 Dec 2021 22:13:13 +0900 Received: from localhost.localdomain (unknown [10.226.36.204]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 09D5543A1810; Fri, 24 Dec 2021 22:13:11 +0900 (JST) From: Lad Prabhakar To: Damien Le Moal Cc: Sergey Shtylyov , Rob Herring , linux-kernel@vger.kernel.org, Prabhakar , Lad Prabhakar , linux-ide@vger.kernel.org Subject: [PATCH v3 04/10] ata: pata_platform: Use platform_get_irq_optional() to get the interrupt Date: Fri, 24 Dec 2021 13:12:53 +0000 Message-Id: <20211224131300.18198-5-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211224131300.18198-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20211224131300.18198-1-prabhakar.mahadev-lad.rj@bp.renesas.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" To be consistent with pata_of_platform driver use platform_get_irq_optional() instead of platform_get_resource(pdev, IORESOURCE_IRQ, 0). Signed-off-by: Lad Prabhakar --- v2-->v3 * New patch --- drivers/ata/pata_platform.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/drivers/ata/pata_platform.c b/drivers/ata/pata_platform.c index 29902001e223..2e439b923762 100644 --- a/drivers/ata/pata_platform.c +++ b/drivers/ata/pata_platform.c @@ -184,8 +184,9 @@ static int pata_platform_probe(struct platform_device *= pdev) { struct resource *io_res; struct resource *ctl_res; - struct resource *irq_res; + struct resource irq_res; struct pata_platform_info *pp_info =3D dev_get_platdata(&pdev->dev); + int irq; =20 /* * Simple resource validation .. @@ -212,9 +213,15 @@ static int pata_platform_probe(struct platform_device = *pdev) /* * And the IRQ */ - irq_res =3D platform_get_resource(pdev, IORESOURCE_IRQ, 0); + irq =3D platform_get_irq_optional(pdev, 0); + if (irq < 0 && irq !=3D -ENXIO) + return irq; + if (irq > 0) { + memset(&irq_res, 0x0, sizeof(struct resource)); + irq_res.start =3D irq; + } =20 - return __pata_platform_probe(&pdev->dev, io_res, ctl_res, irq_res, + return __pata_platform_probe(&pdev->dev, io_res, ctl_res, irq > 0 ? &irq_= res : NULL, pp_info ? pp_info->ioport_shift : 0, pio_mask, &pata_platform_sht, false); } --=20 2.17.1 From nobody Wed Jul 1 08:56:42 2026 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 5A8D5C433F5 for ; Fri, 24 Dec 2021 13:13:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352814AbhLXNNV (ORCPT ); Fri, 24 Dec 2021 08:13:21 -0500 Received: from relmlor1.renesas.com ([210.160.252.171]:58378 "EHLO relmlie5.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1352763AbhLXNNQ (ORCPT ); Fri, 24 Dec 2021 08:13:16 -0500 X-IronPort-AV: E=Sophos;i="5.88,232,1635174000"; d="scan'208";a="104620431" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie5.idc.renesas.com with ESMTP; 24 Dec 2021 22:13:15 +0900 Received: from localhost.localdomain (unknown [10.226.36.204]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 5113143A180E; Fri, 24 Dec 2021 22:13:14 +0900 (JST) From: Lad Prabhakar To: Damien Le Moal Cc: Sergey Shtylyov , Rob Herring , linux-kernel@vger.kernel.org, Prabhakar , Lad Prabhakar , linux-ide@vger.kernel.org Subject: [PATCH v3 05/10] ata: pata_platform: Drop checking IRQ number Date: Fri, 24 Dec 2021 13:12:54 +0000 Message-Id: <20211224131300.18198-6-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211224131300.18198-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20211224131300.18198-1-prabhakar.mahadev-lad.rj@bp.renesas.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The callers of __pata_platform_probe() will pass the IRQ resource only for valid IRQ's, for invalid IRQ's the IRQ resource will always be NULL. So drop checking the IRQ number. Signed-off-by: Lad Prabhakar --- v2-->v3 * New patch --- drivers/ata/pata_platform.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/ata/pata_platform.c b/drivers/ata/pata_platform.c index 2e439b923762..f500f631f72b 100644 --- a/drivers/ata/pata_platform.c +++ b/drivers/ata/pata_platform.c @@ -114,7 +114,7 @@ int __pata_platform_probe(struct device *dev, struct re= source *io_res, /* * And the IRQ */ - if (irq_res && irq_res->start > 0) { + if (irq_res) { irq =3D irq_res->start; irq_flags =3D (irq_res->flags & IRQF_TRIGGER_MASK) | IRQF_SHARED; } --=20 2.17.1 From nobody Wed Jul 1 08:56:42 2026 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 A4290C433F5 for ; Fri, 24 Dec 2021 13:13:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352845AbhLXNN2 (ORCPT ); Fri, 24 Dec 2021 08:13:28 -0500 Received: from relmlor1.renesas.com ([210.160.252.171]:37061 "EHLO relmlie5.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1352789AbhLXNNT (ORCPT ); Fri, 24 Dec 2021 08:13:19 -0500 X-IronPort-AV: E=Sophos;i="5.88,232,1635174000"; d="scan'208";a="104620434" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie5.idc.renesas.com with ESMTP; 24 Dec 2021 22:13:18 +0900 Received: from localhost.localdomain (unknown [10.226.36.204]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 9A07143A180E; Fri, 24 Dec 2021 22:13:16 +0900 (JST) From: Lad Prabhakar To: Damien Le Moal Cc: Sergey Shtylyov , Rob Herring , linux-kernel@vger.kernel.org, Prabhakar , Lad Prabhakar , linux-ide@vger.kernel.org Subject: [PATCH v3 06/10] ata: pata_of_platform: Make use of platform_get_mem_or_io() Date: Fri, 24 Dec 2021 13:12:55 +0000 Message-Id: <20211224131300.18198-7-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211224131300.18198-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20211224131300.18198-1-prabhakar.mahadev-lad.rj@bp.renesas.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" To be consistent with pata_platform driver use platform_get_mem_or_io() instead of of_address_to_resource(). Suggested-by: Sergey Shtylyov Signed-off-by: Lad Prabhakar --- v2-->v3 * New patch --- drivers/ata/pata_of_platform.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/drivers/ata/pata_of_platform.c b/drivers/ata/pata_of_platform.c index 2e2ec7d77726..b9c9b7311112 100644 --- a/drivers/ata/pata_of_platform.c +++ b/drivers/ata/pata_of_platform.c @@ -8,7 +8,6 @@ =20 #include #include -#include #include #include #include @@ -21,10 +20,9 @@ static struct scsi_host_template pata_platform_sht =3D { =20 static int pata_of_platform_probe(struct platform_device *ofdev) { - int ret; struct device_node *dn =3D ofdev->dev.of_node; - struct resource io_res; - struct resource ctl_res; + struct resource *io_res; + struct resource *ctl_res; struct resource irq_res; unsigned int reg_shift =3D 0; int pio_mode =3D 0; @@ -32,15 +30,15 @@ static int pata_of_platform_probe(struct platform_devic= e *ofdev) bool use16bit; int irq; =20 - ret =3D of_address_to_resource(dn, 0, &io_res); - if (ret) { + io_res =3D platform_get_mem_or_io(ofdev, 0); + if (!io_res) { dev_err(&ofdev->dev, "can't get IO address from " "device tree\n"); return -EINVAL; } =20 - ret =3D of_address_to_resource(dn, 1, &ctl_res); - if (ret) { + ctl_res =3D platform_get_mem_or_io(ofdev, 1); + if (!ctl_res) { dev_err(&ofdev->dev, "can't get CTL address from " "device tree\n"); return -EINVAL; @@ -71,7 +69,7 @@ static int pata_of_platform_probe(struct platform_device = *ofdev) pio_mask =3D 1 << pio_mode; pio_mask |=3D (1 << pio_mode) - 1; =20 - return __pata_platform_probe(&ofdev->dev, &io_res, &ctl_res, irq > 0 ? &i= rq_res : NULL, + return __pata_platform_probe(&ofdev->dev, io_res, ctl_res, irq > 0 ? &irq= _res : NULL, reg_shift, pio_mask, &pata_platform_sht, use16bit); } --=20 2.17.1 From nobody Wed Jul 1 08:56:42 2026 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 96737C433EF for ; Fri, 24 Dec 2021 13:13:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352770AbhLXNNf (ORCPT ); Fri, 24 Dec 2021 08:13:35 -0500 Received: from relmlor2.renesas.com ([210.160.252.172]:53177 "EHLO relmlie6.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1352812AbhLXNNW (ORCPT ); Fri, 24 Dec 2021 08:13:22 -0500 X-IronPort-AV: E=Sophos;i="5.88,232,1635174000"; d="scan'208";a="105104967" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie6.idc.renesas.com with ESMTP; 24 Dec 2021 22:13:21 +0900 Received: from localhost.localdomain (unknown [10.226.36.204]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id DB4CD43A180E; Fri, 24 Dec 2021 22:13:19 +0900 (JST) From: Lad Prabhakar To: Damien Le Moal Cc: Sergey Shtylyov , Rob Herring , linux-kernel@vger.kernel.org, Prabhakar , Lad Prabhakar , linux-ide@vger.kernel.org Subject: [PATCH v3 07/10] ata: pata_platform: Merge pata_of_platform into pata_platform Date: Fri, 24 Dec 2021 13:12:56 +0000 Message-Id: <20211224131300.18198-8-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211224131300.18198-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20211224131300.18198-1-prabhakar.mahadev-lad.rj@bp.renesas.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Merge the OF pata_of_platform driver into pata_platform. Signed-off-by: Lad Prabhakar --- v2-->v3 * Introduced new function pata_platform_get_resources() v1-->v2 * Dropped check for IRQ0 * Dropped setting the irqflags as suggested by Rob * Set just the irq start * Fixed freeing up irq_res when not present in DT * Dropped PATA_OF_PLATFORM entry * Split up sorting of headers in separate patch * Dropped sht from struct pata_platform_priv --- drivers/ata/Kconfig | 10 -- drivers/ata/Makefile | 1 - drivers/ata/pata_of_platform.c | 96 ---------------- drivers/ata/pata_platform.c | 194 +++++++++++++++++++++++---------- include/linux/ata_platform.h | 9 -- 5 files changed, 139 insertions(+), 171 deletions(-) delete mode 100644 drivers/ata/pata_of_platform.c diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig index a7da8ea7b3ed..0132a6a49247 100644 --- a/drivers/ata/Kconfig +++ b/drivers/ata/Kconfig @@ -1120,16 +1120,6 @@ config PATA_PLATFORM =20 If unsure, say N. =20 -config PATA_OF_PLATFORM - tristate "OpenFirmware platform device PATA support" - depends on PATA_PLATFORM && OF - help - This option enables support for generic directly connected ATA - devices commonly found on embedded systems with OpenFirmware - bindings. - - If unsure, say N. - config PATA_QDI tristate "QDI VLB PATA support" depends on ISA diff --git a/drivers/ata/Makefile b/drivers/ata/Makefile index b8aebfb14e82..0323b2be1b2f 100644 --- a/drivers/ata/Makefile +++ b/drivers/ata/Makefile @@ -107,7 +107,6 @@ obj-$(CONFIG_PATA_OPTI) +=3D pata_opti.o obj-$(CONFIG_PATA_PCMCIA) +=3D pata_pcmcia.o obj-$(CONFIG_PATA_PALMLD) +=3D pata_palmld.o obj-$(CONFIG_PATA_PLATFORM) +=3D pata_platform.o -obj-$(CONFIG_PATA_OF_PLATFORM) +=3D pata_of_platform.o obj-$(CONFIG_PATA_RB532) +=3D pata_rb532_cf.o obj-$(CONFIG_PATA_RZ1000) +=3D pata_rz1000.o obj-$(CONFIG_PATA_SAMSUNG_CF) +=3D pata_samsung_cf.o diff --git a/drivers/ata/pata_of_platform.c b/drivers/ata/pata_of_platform.c deleted file mode 100644 index b9c9b7311112..000000000000 --- a/drivers/ata/pata_of_platform.c +++ /dev/null @@ -1,96 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-only -/* - * OF-platform PATA driver - * - * Copyright (c) 2007 MontaVista Software, Inc. - * Anton Vorontsov - */ - -#include -#include -#include -#include -#include - -#define DRV_NAME "pata_of_platform" - -static struct scsi_host_template pata_platform_sht =3D { - ATA_PIO_SHT(DRV_NAME), -}; - -static int pata_of_platform_probe(struct platform_device *ofdev) -{ - struct device_node *dn =3D ofdev->dev.of_node; - struct resource *io_res; - struct resource *ctl_res; - struct resource irq_res; - unsigned int reg_shift =3D 0; - int pio_mode =3D 0; - int pio_mask; - bool use16bit; - int irq; - - io_res =3D platform_get_mem_or_io(ofdev, 0); - if (!io_res) { - dev_err(&ofdev->dev, "can't get IO address from " - "device tree\n"); - return -EINVAL; - } - - ctl_res =3D platform_get_mem_or_io(ofdev, 1); - if (!ctl_res) { - dev_err(&ofdev->dev, "can't get CTL address from " - "device tree\n"); - return -EINVAL; - } - - irq =3D platform_get_irq_optional(ofdev, 0); - if (irq < 0 && irq !=3D -ENXIO) - return irq; - - if (irq > 0) { - memset(&irq_res, 0x0, sizeof(struct resource)); - irq_res.start =3D irq; - } - - of_property_read_u32(dn, "reg-shift", ®_shift); - - if (!of_property_read_u32(dn, "pio-mode", &pio_mode)) { - if (pio_mode > 6) { - dev_err(&ofdev->dev, "invalid pio-mode\n"); - return -EINVAL; - } - } else { - dev_info(&ofdev->dev, "pio-mode unspecified, assuming PIO0\n"); - } - - use16bit =3D of_property_read_bool(dn, "ata-generic,use16bit"); - - pio_mask =3D 1 << pio_mode; - pio_mask |=3D (1 << pio_mode) - 1; - - return __pata_platform_probe(&ofdev->dev, io_res, ctl_res, irq > 0 ? &irq= _res : NULL, - reg_shift, pio_mask, &pata_platform_sht, - use16bit); -} - -static const struct of_device_id pata_of_platform_match[] =3D { - { .compatible =3D "ata-generic", }, - { }, -}; -MODULE_DEVICE_TABLE(of, pata_of_platform_match); - -static struct platform_driver pata_of_platform_driver =3D { - .driver =3D { - .name =3D DRV_NAME, - .of_match_table =3D pata_of_platform_match, - }, - .probe =3D pata_of_platform_probe, - .remove =3D ata_platform_remove_one, -}; - -module_platform_driver(pata_of_platform_driver); - -MODULE_DESCRIPTION("OF-platform PATA driver"); -MODULE_AUTHOR("Anton Vorontsov "); -MODULE_LICENSE("GPL"); diff --git a/drivers/ata/pata_platform.c b/drivers/ata/pata_platform.c index f500f631f72b..4273f1a9abd2 100644 --- a/drivers/ata/pata_platform.c +++ b/drivers/ata/pata_platform.c @@ -25,7 +25,25 @@ =20 static int pio_mask =3D 1; module_param(pio_mask, int, 0); -MODULE_PARM_DESC(pio_mask, "PIO modes supported, mode 0 only by default"); +MODULE_PARM_DESC(pio_mask, "PIO modes supported, mode 0 only by default (p= aram valid only for non DT users)"); + +/** + * struct pata_platform_priv - Private info + * @io_res: Resource representing I/O base + * @ctl_res: Resource representing CTL base + * @irq_res: Resource representing IRQ and its flags + * @ioport_shift: I/O port shift + * @pio_mask: PIO mask + * @use16bit: Flag to indicate 16-bit IO instead of 32-bit + */ +struct pata_platform_priv { + struct resource *io_res; + struct resource *ctl_res; + struct resource *irq_res; + unsigned int ioport_shift; + int pio_mask; + bool use16bit; +}; =20 /* * Provide our own set_mode() as we don't want to change anything that has @@ -66,15 +84,9 @@ static void pata_platform_setup_port(struct ata_ioports = *ioaddr, } =20 /** - * __pata_platform_probe - attach a platform interface + * pata_platform_host_activate - attach a platform interface * @dev: device - * @io_res: Resource representing I/O base - * @ctl_res: Resource representing CTL base - * @irq_res: Resource representing IRQ and its flags - * @ioport_shift: I/O port shift - * @__pio_mask: PIO mask - * @sht: scsi_host_template to use when registering - * @use16bit: Flag to indicate 16-bit IO instead of 32-bit + * @priv: Pointer to struct pata_platform_priv * * Register a platform bus IDE interface. Such interfaces are PIO and we * assume do not support IRQ sharing. @@ -94,10 +106,7 @@ static void pata_platform_setup_port(struct ata_ioports= *ioaddr, * * If no IRQ resource is present, PIO polling mode is used instead. */ -int __pata_platform_probe(struct device *dev, struct resource *io_res, - struct resource *ctl_res, struct resource *irq_res, - unsigned int ioport_shift, int __pio_mask, - struct scsi_host_template *sht, bool use16bit) +static int pata_platform_host_activate(struct device *dev, struct pata_pla= tform_priv *priv) { struct ata_host *host; struct ata_port *ap; @@ -108,15 +117,15 @@ int __pata_platform_probe(struct device *dev, struct = resource *io_res, /* * Check for MMIO */ - mmio =3D (( io_res->flags =3D=3D IORESOURCE_MEM) && - (ctl_res->flags =3D=3D IORESOURCE_MEM)); + mmio =3D ((priv->io_res->flags =3D=3D IORESOURCE_MEM) && + (priv->ctl_res->flags =3D=3D IORESOURCE_MEM)); =20 /* * And the IRQ */ - if (irq_res) { - irq =3D irq_res->start; - irq_flags =3D (irq_res->flags & IRQF_TRIGGER_MASK) | IRQF_SHARED; + if (priv->irq_res && priv->irq_res->start > 0) { + irq =3D priv->irq_res->start; + irq_flags =3D (priv->irq_res->flags & IRQF_TRIGGER_MASK) | IRQF_SHARED; } =20 /* @@ -131,12 +140,12 @@ int __pata_platform_probe(struct device *dev, struct = resource *io_res, ap->ops->inherits =3D &ata_sff_port_ops; ap->ops->cable_detect =3D ata_cable_unknown; ap->ops->set_mode =3D pata_platform_set_mode; - if (use16bit) + if (priv->use16bit) ap->ops->sff_data_xfer =3D ata_sff_data_xfer; else ap->ops->sff_data_xfer =3D ata_sff_data_xfer32; =20 - ap->pio_mask =3D __pio_mask; + ap->pio_mask =3D priv->pio_mask; ap->flags |=3D ATA_FLAG_SLAVE_POSS; =20 /* @@ -151,15 +160,15 @@ int __pata_platform_probe(struct device *dev, struct = resource *io_res, * Handle the MMIO case */ if (mmio) { - ap->ioaddr.cmd_addr =3D devm_ioremap(dev, io_res->start, - resource_size(io_res)); - ap->ioaddr.ctl_addr =3D devm_ioremap(dev, ctl_res->start, - resource_size(ctl_res)); + ap->ioaddr.cmd_addr =3D devm_ioremap(dev, priv->io_res->start, + resource_size(priv->io_res)); + ap->ioaddr.ctl_addr =3D devm_ioremap(dev, priv->ctl_res->start, + resource_size(priv->ctl_res)); } else { - ap->ioaddr.cmd_addr =3D devm_ioport_map(dev, io_res->start, - resource_size(io_res)); - ap->ioaddr.ctl_addr =3D devm_ioport_map(dev, ctl_res->start, - resource_size(ctl_res)); + ap->ioaddr.cmd_addr =3D devm_ioport_map(dev, priv->io_res->start, + resource_size(priv->io_res)); + ap->ioaddr.ctl_addr =3D devm_ioport_map(dev, priv->ctl_res->start, + resource_size(priv->ctl_res)); } if (!ap->ioaddr.cmd_addr || !ap->ioaddr.ctl_addr) { dev_err(dev, "failed to map IO/CTL base\n"); @@ -168,46 +177,34 @@ int __pata_platform_probe(struct device *dev, struct = resource *io_res, =20 ap->ioaddr.altstatus_addr =3D ap->ioaddr.ctl_addr; =20 - pata_platform_setup_port(&ap->ioaddr, ioport_shift); + pata_platform_setup_port(&ap->ioaddr, priv->ioport_shift); =20 ata_port_desc(ap, "%s cmd 0x%llx ctl 0x%llx", mmio ? "mmio" : "ioport", - (unsigned long long)io_res->start, - (unsigned long long)ctl_res->start); + (unsigned long long)priv->io_res->start, + (unsigned long long)priv->ctl_res->start); =20 /* activate */ return ata_host_activate(host, irq, irq ? ata_sff_interrupt : NULL, - irq_flags, sht); + irq_flags, &pata_platform_sht); } -EXPORT_SYMBOL_GPL(__pata_platform_probe); =20 -static int pata_platform_probe(struct platform_device *pdev) +static int pata_platform_get_resources(struct platform_device *pdev, + struct pata_platform_priv *priv) { - struct resource *io_res; - struct resource *ctl_res; - struct resource irq_res; - struct pata_platform_info *pp_info =3D dev_get_platdata(&pdev->dev); int irq; =20 - /* - * Simple resource validation .. - */ - if ((pdev->num_resources !=3D 3) && (pdev->num_resources !=3D 2)) { - dev_err(&pdev->dev, "invalid number of resources\n"); - return -EINVAL; - } - /* * Get the I/O base first */ - io_res =3D platform_get_mem_or_io(pdev, 0); - if (!io_res) + priv->io_res =3D platform_get_mem_or_io(pdev, 0); + if (!priv->io_res) return -EINVAL; =20 /* * Then the CTL base */ - ctl_res =3D platform_get_mem_or_io(pdev, 1); - if (!ctl_res) + priv->ctl_res =3D platform_get_mem_or_io(pdev, 1); + if (!priv->ctl_res) return -EINVAL; =20 /* @@ -216,21 +213,108 @@ static int pata_platform_probe(struct platform_devic= e *pdev) irq =3D platform_get_irq_optional(pdev, 0); if (irq < 0 && irq !=3D -ENXIO) return irq; + if (irq > 0) { - memset(&irq_res, 0x0, sizeof(struct resource)); - irq_res.start =3D irq; + struct resource *irq_res; + + irq_res =3D devm_kzalloc(&pdev->dev, sizeof(*irq_res), GFP_KERNEL); + if (!irq_res) + return -ENOMEM; + + irq_res->start =3D irq; + priv->irq_res =3D irq_res; } =20 - return __pata_platform_probe(&pdev->dev, io_res, ctl_res, irq > 0 ? &irq_= res : NULL, - pp_info ? pp_info->ioport_shift : 0, - pio_mask, &pata_platform_sht, false); + return 0; } =20 +static int pata_of_platform_get_pdata(struct platform_device *ofdev, + struct pata_platform_priv *priv) +{ + struct device_node *dn =3D ofdev->dev.of_node; + int pio_mode =3D 0; + int ret; + + ret =3D pata_platform_get_resources(ofdev, priv); + if (ret) + return ret; + + of_property_read_u32(dn, "reg-shift", &priv->ioport_shift); + + ret =3D of_property_read_u32(dn, "pio-mode", &pio_mode); + if (!ret) { + if (pio_mode > 6) { + dev_err(&ofdev->dev, "invalid pio-mode\n"); + return -EINVAL; + } + } else { + dev_info(&ofdev->dev, "pio-mode unspecified, assuming PIO0\n"); + } + + priv->use16bit =3D of_property_read_bool(dn, "ata-generic,use16bit"); + + priv->pio_mask =3D 1 << pio_mode; + priv->pio_mask |=3D (1 << pio_mode) - 1; + + return 0; +} + +static int pata_platform_get_pdata(struct platform_device *pdev, + struct pata_platform_priv *priv) +{ + struct pata_platform_info *pp_info =3D dev_get_platdata(&pdev->dev); + int ret; + + /* + * Simple resource validation .. + */ + if ((pdev->num_resources !=3D 3) && (pdev->num_resources !=3D 2)) { + dev_err(&pdev->dev, "invalid number of resources\n"); + return -EINVAL; + } + + ret =3D pata_platform_get_resources(pdev, priv); + if (ret) + return ret; + + priv->ioport_shift =3D pp_info ? pp_info->ioport_shift : 0; + priv->pio_mask =3D pio_mask; + priv->use16bit =3D false; + + return 0; +} + +static int pata_platform_probe(struct platform_device *pdev) +{ + struct pata_platform_priv *priv; + int ret; + + priv =3D devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL); + if (!priv) + return -ENOMEM; + + if (!dev_of_node(&pdev->dev)) + ret =3D pata_platform_get_pdata(pdev, priv); + else + ret =3D pata_of_platform_get_pdata(pdev, priv); + if (ret) + return ret; + + return pata_platform_host_activate(&pdev->dev, priv); +} + +static const struct of_device_id pata_of_platform_match[] =3D { + { .compatible =3D "ata-generic", }, + { }, +}; +MODULE_DEVICE_TABLE(of, pata_of_platform_match); + static struct platform_driver pata_platform_driver =3D { .probe =3D pata_platform_probe, .remove =3D ata_platform_remove_one, .driver =3D { .name =3D DRV_NAME, + .of_match_table =3D pata_of_platform_match, }, }; =20 diff --git a/include/linux/ata_platform.h b/include/linux/ata_platform.h index 9cafec92282d..91b8529e6712 100644 --- a/include/linux/ata_platform.h +++ b/include/linux/ata_platform.h @@ -13,15 +13,6 @@ struct pata_platform_info { =20 struct scsi_host_template; =20 -extern int __pata_platform_probe(struct device *dev, - struct resource *io_res, - struct resource *ctl_res, - struct resource *irq_res, - unsigned int ioport_shift, - int __pio_mask, - struct scsi_host_template *sht, - bool use16bit); - /* * Marvell SATA private data */ --=20 2.17.1 From nobody Wed Jul 1 08:56:42 2026 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 33981C433FE for ; Fri, 24 Dec 2021 13:13:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352833AbhLXNNh (ORCPT ); Fri, 24 Dec 2021 08:13:37 -0500 Received: from relmlor2.renesas.com ([210.160.252.172]:63126 "EHLO relmlie6.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1352783AbhLXNNY (ORCPT ); Fri, 24 Dec 2021 08:13:24 -0500 X-IronPort-AV: E=Sophos;i="5.88,232,1635174000"; d="scan'208";a="105104970" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie6.idc.renesas.com with ESMTP; 24 Dec 2021 22:13:23 +0900 Received: from localhost.localdomain (unknown [10.226.36.204]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 2A94A43A180F; Fri, 24 Dec 2021 22:13:21 +0900 (JST) From: Lad Prabhakar To: Damien Le Moal Cc: Sergey Shtylyov , Rob Herring , linux-kernel@vger.kernel.org, Prabhakar , Lad Prabhakar , linux-ide@vger.kernel.org Subject: [PATCH v3 08/10] ata: pata_platform: Drop validating num_resources count Date: Fri, 24 Dec 2021 13:12:57 +0000 Message-Id: <20211224131300.18198-9-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211224131300.18198-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20211224131300.18198-1-prabhakar.mahadev-lad.rj@bp.renesas.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Drop validating num_resources count as pata_platform_get_resources() already does this check for us. Signed-off-by: Lad Prabhakar --- v2-->v3 * New patch --- drivers/ata/pata_platform.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/drivers/ata/pata_platform.c b/drivers/ata/pata_platform.c index 4273f1a9abd2..88a9bdc81e68 100644 --- a/drivers/ata/pata_platform.c +++ b/drivers/ata/pata_platform.c @@ -265,14 +265,6 @@ static int pata_platform_get_pdata(struct platform_dev= ice *pdev, struct pata_platform_info *pp_info =3D dev_get_platdata(&pdev->dev); int ret; =20 - /* - * Simple resource validation .. - */ - if ((pdev->num_resources !=3D 3) && (pdev->num_resources !=3D 2)) { - dev_err(&pdev->dev, "invalid number of resources\n"); - return -EINVAL; - } - ret =3D pata_platform_get_resources(pdev, priv); if (ret) return ret; --=20 2.17.1 From nobody Wed Jul 1 08:56:42 2026 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 3EC5EC433EF for ; Fri, 24 Dec 2021 13:13:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352911AbhLXNNk (ORCPT ); Fri, 24 Dec 2021 08:13:40 -0500 Received: from relmlor2.renesas.com ([210.160.252.172]:45139 "EHLO relmlie6.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1352825AbhLXNN0 (ORCPT ); Fri, 24 Dec 2021 08:13:26 -0500 X-IronPort-AV: E=Sophos;i="5.88,232,1635174000"; d="scan'208";a="105104973" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie6.idc.renesas.com with ESMTP; 24 Dec 2021 22:13:25 +0900 Received: from localhost.localdomain (unknown [10.226.36.204]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 720FA43A180F; Fri, 24 Dec 2021 22:13:24 +0900 (JST) From: Lad Prabhakar To: Damien Le Moal Cc: Sergey Shtylyov , Rob Herring , linux-kernel@vger.kernel.org, Prabhakar , Lad Prabhakar , linux-ide@vger.kernel.org Subject: [PATCH v3 09/10] ata: pata_platform: Sort the #includes alphabetically Date: Fri, 24 Dec 2021 13:12:58 +0000 Message-Id: <20211224131300.18198-10-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211224131300.18198-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20211224131300.18198-1-prabhakar.mahadev-lad.rj@bp.renesas.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Sort the #includes alphabetically. Signed-off-by: Lad Prabhakar --- v2-->v3 * Dropped of_address.h * Dropped RB tag v1-->v2 * New patch --- drivers/ata/pata_platform.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/ata/pata_platform.c b/drivers/ata/pata_platform.c index 88a9bdc81e68..b37c1028fd54 100644 --- a/drivers/ata/pata_platform.c +++ b/drivers/ata/pata_platform.c @@ -11,14 +11,14 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. */ -#include -#include -#include -#include #include +#include +#include +#include #include +#include #include -#include +#include =20 #define DRV_NAME "pata_platform" #define DRV_VERSION "1.2" --=20 2.17.1 From nobody Wed Jul 1 08:56:42 2026 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 C988FC433EF for ; Fri, 24 Dec 2021 13:13:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352789AbhLXNNp (ORCPT ); Fri, 24 Dec 2021 08:13:45 -0500 Received: from relmlor1.renesas.com ([210.160.252.171]:11767 "EHLO relmlie5.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1352840AbhLXNN3 (ORCPT ); Fri, 24 Dec 2021 08:13:29 -0500 X-IronPort-AV: E=Sophos;i="5.88,232,1635174000"; d="scan'208";a="104620443" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie5.idc.renesas.com with ESMTP; 24 Dec 2021 22:13:28 +0900 Received: from localhost.localdomain (unknown [10.226.36.204]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id BB37243A180E; Fri, 24 Dec 2021 22:13:26 +0900 (JST) From: Lad Prabhakar To: Damien Le Moal Cc: Sergey Shtylyov , Rob Herring , linux-kernel@vger.kernel.org, Prabhakar , Lad Prabhakar , linux-ide@vger.kernel.org Subject: [PATCH v3 10/10] ata: pata_platform: Make use of GENMASK() macro Date: Fri, 24 Dec 2021 13:12:59 +0000 Message-Id: <20211224131300.18198-11-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211224131300.18198-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20211224131300.18198-1-prabhakar.mahadev-lad.rj@bp.renesas.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Make use of GENMASK() macro instead of open coding. Signed-off-by: Lad Prabhakar Reviewed-by: Sergey Shtylyov --- v2-->v3 * Included RB tag v1-->v2 * New patch --- drivers/ata/pata_platform.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/ata/pata_platform.c b/drivers/ata/pata_platform.c index b37c1028fd54..b68bce361c74 100644 --- a/drivers/ata/pata_platform.c +++ b/drivers/ata/pata_platform.c @@ -253,8 +253,7 @@ static int pata_of_platform_get_pdata(struct platform_d= evice *ofdev, =20 priv->use16bit =3D of_property_read_bool(dn, "ata-generic,use16bit"); =20 - priv->pio_mask =3D 1 << pio_mode; - priv->pio_mask |=3D (1 << pio_mode) - 1; + priv->pio_mask =3D GENMASK(pio_mode, 0); =20 return 0; } --=20 2.17.1