Skip to content

Commit

Permalink
pata_platform: Remove useless irq_flags field
Browse files Browse the repository at this point in the history
IRQ flags can be obtained from resource structure, there are no need
to use additional field in the platform_data to store these values.
This patch removes this field and convert existing users of this driver
to use IRQ flags from the resources.

Signed-off-by: Alexander Shiyan <[email protected]>
Signed-off-by: Tejun Heo <[email protected]>
  • Loading branch information
shcgit authored and htejun committed Aug 23, 2014
1 parent ca99140 commit 53f3cc4
Show file tree
Hide file tree
Showing 8 changed files with 6 additions and 20 deletions.
3 changes: 1 addition & 2 deletions arch/blackfin/mach-bf537/boards/cm_bf537e.c
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,6 @@ static struct platform_device bfin_mac_device = {

static struct pata_platform_info bfin_pata_platform_data = {
.ioport_shift = 2,
.irq_type = IRQF_TRIGGER_HIGH,
};

static struct resource bfin_pata_resources[] = {
Expand All @@ -750,7 +749,7 @@ static struct resource bfin_pata_resources[] = {
{
.start = PATA_INT,
.end = PATA_INT,
.flags = IORESOURCE_IRQ,
.flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
},
};

Expand Down
3 changes: 1 addition & 2 deletions arch/blackfin/mach-bf537/boards/cm_bf537u.c
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,6 @@ static struct platform_device bfin_mac_device = {

static struct pata_platform_info bfin_pata_platform_data = {
.ioport_shift = 2,
.irq_type = IRQF_TRIGGER_HIGH,
};

static struct resource bfin_pata_resources[] = {
Expand All @@ -604,7 +603,7 @@ static struct resource bfin_pata_resources[] = {
{
.start = PATA_INT,
.end = PATA_INT,
.flags = IORESOURCE_IRQ,
.flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
},
};

Expand Down
3 changes: 1 addition & 2 deletions arch/blackfin/mach-bf537/boards/stamp.c
Original file line number Diff line number Diff line change
Expand Up @@ -2462,7 +2462,6 @@ static struct platform_device bfin_sport0_device = {
#define PATA_INT IRQ_PF5
static struct pata_platform_info bfin_pata_platform_data = {
.ioport_shift = 1,
.irq_flags = IRQF_TRIGGER_HIGH,
};

static struct resource bfin_pata_resources[] = {
Expand All @@ -2479,7 +2478,7 @@ static struct resource bfin_pata_resources[] = {
{
.start = PATA_INT,
.end = PATA_INT,
.flags = IORESOURCE_IRQ,
.flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
},
};
#elif defined(CF_IDE_NAND_CARD_USE_CF_IN_COMMON_MEMORY_MODE)
Expand Down
3 changes: 1 addition & 2 deletions arch/blackfin/mach-bf537/boards/tcm_bf537.c
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,6 @@ static struct platform_device bfin_mac_device = {

static struct pata_platform_info bfin_pata_platform_data = {
.ioport_shift = 2,
.irq_type = IRQF_TRIGGER_HIGH,
};

static struct resource bfin_pata_resources[] = {
Expand All @@ -606,7 +605,7 @@ static struct resource bfin_pata_resources[] = {
{
.start = PATA_INT,
.end = PATA_INT,
.flags = IORESOURCE_IRQ,
.flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
},
};

Expand Down
3 changes: 1 addition & 2 deletions arch/blackfin/mach-bf561/boards/cm_bf561.c
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,6 @@ static struct platform_device bfin_sir0_device = {

static struct pata_platform_info bfin_pata_platform_data = {
.ioport_shift = 2,
.irq_type = IRQF_TRIGGER_HIGH,
};

static struct resource bfin_pata_resources[] = {
Expand All @@ -371,7 +370,7 @@ static struct resource bfin_pata_resources[] = {
{
.start = PATA_INT,
.end = PATA_INT,
.flags = IORESOURCE_IRQ,
.flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
},
};

Expand Down
2 changes: 0 additions & 2 deletions drivers/ata/pata_of_platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ static int pata_of_platform_probe(struct platform_device *ofdev)
}

irq_res = platform_get_resource(ofdev, IORESOURCE_IRQ, 0);
if (irq_res)
irq_res->flags = 0;

prop = of_get_property(dn, "reg-shift", NULL);
if (prop)
Expand Down
4 changes: 1 addition & 3 deletions drivers/ata/pata_platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ int __pata_platform_probe(struct device *dev, struct resource *io_res,
*/
if (irq_res && irq_res->start > 0) {
irq = irq_res->start;
irq_flags = irq_res->flags;
irq_flags = irq_res->flags & IRQF_TRIGGER_MASK;
}

/*
Expand Down Expand Up @@ -213,8 +213,6 @@ static int pata_platform_probe(struct platform_device *pdev)
* And the IRQ
*/
irq_res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
if (irq_res)
irq_res->flags = pp_info ? pp_info->irq_flags : 0;

return __pata_platform_probe(&pdev->dev, io_res, ctl_res, irq_res,
pp_info ? pp_info->ioport_shift : 0,
Expand Down
5 changes: 0 additions & 5 deletions include/linux/ata_platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@ struct pata_platform_info {
* spacing used by ata_std_ports().
*/
unsigned int ioport_shift;
/*
* Indicate platform specific irq types and initial
* IRQ flags when call request_irq()
*/
unsigned int irq_flags;
};

extern int __pata_platform_probe(struct device *dev,
Expand Down

0 comments on commit 53f3cc4

Please sign in to comment.