lkml.org 
[lkml]   [2021]   [Dec]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH v3 04/10] ata: pata_platform: Use platform_get_irq_optional() to get the interrupt
    Date
    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 <prabhakar.mahadev-lad.rj@bp.renesas.com>
    ---
    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 = dev_get_platdata(&pdev->dev);
    + int irq;

    /*
    * Simple resource validation ..
    @@ -212,9 +213,15 @@ static int pata_platform_probe(struct platform_device *pdev)
    /*
    * And the IRQ
    */
    - irq_res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
    + irq = platform_get_irq_optional(pdev, 0);
    + if (irq < 0 && irq != -ENXIO)
    + return irq;
    + if (irq > 0) {
    + memset(&irq_res, 0x0, sizeof(struct resource));
    + irq_res.start = irq;
    + }

    - 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);
    }
    --
    2.17.1
    \
     
     \ /
      Last update: 2021-12-24 14:14    [W:4.024 / U:0.148 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site