Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1288541 > unrolled thread

[PATCH] hisi_sas: use platform_get_irq()

Started byJohn Garry <john.garry@huawei.com>
First post2015-12-10 15:50 +0100
Last post2015-12-11 11:20 +0100
Articles 3 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] hisi_sas: use platform_get_irq() John Garry <john.garry@huawei.com> - 2015-12-10 15:50 +0100
    Re: [PATCH] hisi_sas: use platform_get_irq() Rob Herring <robh@kernel.org> - 2015-12-10 21:10 +0100
      Re: [PATCH] hisi_sas: use platform_get_irq() John Garry <john.garry@huawei.com> - 2015-12-11 11:20 +0100

#1288541 — [PATCH] hisi_sas: use platform_get_irq()

FromJohn Garry <john.garry@huawei.com>
Date2015-12-10 15:50 +0100
Subject[PATCH] hisi_sas: use platform_get_irq()
Message-ID<qEaHD-7v5-7@gated-at.bofh.it>
It is preferred that drivers use platform_get_irq()
instead of irq_of_parse_and_map(), so replace.

Signed-off-by: John Garry <john.garry@huawei.com>

diff --git a/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c
index 89ae31d..e907758 100644
--- a/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c
+++ b/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c
@@ -1673,19 +1673,16 @@ static irq_handler_t fatal_interrupts[HISI_SAS_MAX_QUEUES] = {
 
 static int interrupt_init_v1_hw(struct hisi_hba *hisi_hba)
 {
-	struct device *dev = &hisi_hba->pdev->dev;
-	struct device_node *np = dev->of_node;
+	struct platform_device *pdev = hisi_hba->pdev;
+	struct device *dev = &pdev->dev;
 	int i, j, irq, rc, idx;
 
-	if (!np)
-		return -ENOENT;
-
 	for (i = 0; i < hisi_hba->n_phy; i++) {
 		struct hisi_sas_phy *phy = &hisi_hba->phy[i];
 
 		idx = i * HISI_SAS_PHY_INT_NR;
 		for (j = 0; j < HISI_SAS_PHY_INT_NR; j++, idx++) {
-			irq = irq_of_parse_and_map(np, idx);
+			irq = platform_get_irq(pdev, idx);
 			if (!irq) {
 				dev_err(dev,
 					"irq init: fail map phy interrupt %d\n",
@@ -1706,7 +1703,7 @@ static int interrupt_init_v1_hw(struct hisi_hba *hisi_hba)
 
 	idx = hisi_hba->n_phy * HISI_SAS_PHY_INT_NR;
 	for (i = 0; i < hisi_hba->queue_count; i++, idx++) {
-		irq = irq_of_parse_and_map(np, idx);
+		irq = platform_get_irq(pdev, idx);
 		if (!irq) {
 			dev_err(dev, "irq init: could not map cq interrupt %d\n",
 				idx);
@@ -1724,7 +1721,7 @@ static int interrupt_init_v1_hw(struct hisi_hba *hisi_hba)
 
 	idx = (hisi_hba->n_phy * HISI_SAS_PHY_INT_NR) + hisi_hba->queue_count;
 	for (i = 0; i < HISI_SAS_FATAL_INT_NR; i++, idx++) {
-		irq = irq_of_parse_and_map(np, idx);
+		irq = platform_get_irq(pdev, idx);
 		if (!irq) {
 			dev_err(dev, "irq init: could not map fatal interrupt %d\n",
 				idx);
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1288891

FromRob Herring <robh@kernel.org>
Date2015-12-10 21:10 +0100
Message-ID<qEfHk-2rH-9@gated-at.bofh.it>
In reply to#1288541
On Thu, Dec 10, 2015 at 9:02 AM, John Garry <john.garry@huawei.com> wrote:
> It is preferred that drivers use platform_get_irq()
> instead of irq_of_parse_and_map(), so replace.

You may be able to stop including of_irq.h with this change. Otherwise,

Acked-by: Rob Herring <robh@kernel.org>

>
> Signed-off-by: John Garry <john.garry@huawei.com>
>
> diff --git a/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c
> index 89ae31d..e907758 100644
> --- a/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c
> +++ b/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c
> @@ -1673,19 +1673,16 @@ static irq_handler_t fatal_interrupts[HISI_SAS_MAX_QUEUES] = {
>
>  static int interrupt_init_v1_hw(struct hisi_hba *hisi_hba)
>  {
> -       struct device *dev = &hisi_hba->pdev->dev;
> -       struct device_node *np = dev->of_node;
> +       struct platform_device *pdev = hisi_hba->pdev;
> +       struct device *dev = &pdev->dev;
>         int i, j, irq, rc, idx;
>
> -       if (!np)
> -               return -ENOENT;
> -
>         for (i = 0; i < hisi_hba->n_phy; i++) {
>                 struct hisi_sas_phy *phy = &hisi_hba->phy[i];
>
>                 idx = i * HISI_SAS_PHY_INT_NR;
>                 for (j = 0; j < HISI_SAS_PHY_INT_NR; j++, idx++) {
> -                       irq = irq_of_parse_and_map(np, idx);
> +                       irq = platform_get_irq(pdev, idx);
>                         if (!irq) {
>                                 dev_err(dev,
>                                         "irq init: fail map phy interrupt %d\n",
> @@ -1706,7 +1703,7 @@ static int interrupt_init_v1_hw(struct hisi_hba *hisi_hba)
>
>         idx = hisi_hba->n_phy * HISI_SAS_PHY_INT_NR;
>         for (i = 0; i < hisi_hba->queue_count; i++, idx++) {
> -               irq = irq_of_parse_and_map(np, idx);
> +               irq = platform_get_irq(pdev, idx);
>                 if (!irq) {
>                         dev_err(dev, "irq init: could not map cq interrupt %d\n",
>                                 idx);
> @@ -1724,7 +1721,7 @@ static int interrupt_init_v1_hw(struct hisi_hba *hisi_hba)
>
>         idx = (hisi_hba->n_phy * HISI_SAS_PHY_INT_NR) + hisi_hba->queue_count;
>         for (i = 0; i < HISI_SAS_FATAL_INT_NR; i++, idx++) {
> -               irq = irq_of_parse_and_map(np, idx);
> +               irq = platform_get_irq(pdev, idx);
>                 if (!irq) {
>                         dev_err(dev, "irq init: could not map fatal interrupt %d\n",
>                                 idx);
> --
> 1.9.1
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1289387

FromJohn Garry <john.garry@huawei.com>
Date2015-12-11 11:20 +0100
Message-ID<qEsXV-2Ss-17@gated-at.bofh.it>
In reply to#1288891
On 10/12/2015 20:08, Rob Herring wrote:
> On Thu, Dec 10, 2015 at 9:02 AM, John Garry <john.garry@huawei.com> wrote:
>> It is preferred that drivers use platform_get_irq()
>> instead of irq_of_parse_and_map(), so replace.
>
> You may be able to stop including of_irq.h with this change. Otherwise,
>

Right, I don't think it is required any longer. I'll generate another patch.

Thanks,


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web