Skip to content

Commit 57bf0f5

Browse files
committed
ARM: pxa: use pdev resource for palmld mmio
The palmld header is almost unused in drivers, the only remaining thing now is the PATA device address, which should really be passed as a resource. Cc: [email protected] Acked-by: Robert Jarzmik <[email protected]> Acked-by: Bartlomiej Zolnierkiewicz <[email protected]> Acked-by: Damien Le Moal <[email protected]> Signed-off-by: Arnd Bergmann <[email protected]>
1 parent 225b5d3 commit 57bf0f5

File tree

4 files changed

+13
-7
lines changed

4 files changed

+13
-7
lines changed

arch/arm/mach-pxa/palmld-pcmcia.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,10 @@
1313
#include <linux/gpio.h>
1414

1515
#include <asm/mach-types.h>
16-
#include <mach/palmld.h>
1716
#include <pcmcia/soc_common.h>
1817

18+
#include "palmld.h"
19+
1920
static struct gpio palmld_pcmcia_gpios[] = {
2021
{ GPIO_NR_PALMLD_PCMCIA_POWER, GPIOF_INIT_LOW, "PCMCIA Power" },
2122
{ GPIO_NR_PALMLD_PCMCIA_RESET, GPIOF_INIT_HIGH,"PCMCIA Reset" },

arch/arm/mach-pxa/palmld.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929
#include <asm/mach/map.h>
3030

3131
#include "pxa27x.h"
32+
#include "palmld.h"
3233
#include <linux/platform_data/asoc-pxa.h>
33-
#include <mach/palmld.h>
3434
#include <linux/platform_data/mmc-pxamci.h>
3535
#include <linux/platform_data/video-pxafb.h>
3636
#include <linux/platform_data/irda-pxaficp.h>
@@ -279,9 +279,15 @@ static inline void palmld_leds_init(void) {}
279279
* HDD
280280
******************************************************************************/
281281
#if defined(CONFIG_PATA_PALMLD) || defined(CONFIG_PATA_PALMLD_MODULE)
282+
static struct resource palmld_ide_resources[] = {
283+
DEFINE_RES_MEM(PALMLD_IDE_PHYS, 0x1000),
284+
};
285+
282286
static struct platform_device palmld_ide_device = {
283-
.name = "pata_palmld",
284-
.id = -1,
287+
.name = "pata_palmld",
288+
.id = -1,
289+
.resource = palmld_ide_resources,
290+
.num_resources = ARRAY_SIZE(palmld_ide_resources),
285291
};
286292

287293
static struct gpiod_lookup_table palmld_ide_gpio_table = {

arch/arm/mach-pxa/include/mach/palmld.h renamed to arch/arm/mach-pxa/palmld.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#ifndef _INCLUDE_PALMLD_H_
1010
#define _INCLUDE_PALMLD_H_
1111

12-
#include "irqs.h" /* PXA_GPIO_TO_IRQ */
12+
#include <mach/irqs.h> /* PXA_GPIO_TO_IRQ */
1313

1414
/** HERE ARE GPIOs **/
1515

drivers/ata/pata_palmld.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
#include <linux/gpio/consumer.h>
2626

2727
#include <scsi/scsi_host.h>
28-
#include <mach/palmld.h>
2928

3029
#define DRV_NAME "pata_palmld"
3130

@@ -63,7 +62,7 @@ static int palmld_pata_probe(struct platform_device *pdev)
6362
return -ENOMEM;
6463

6564
/* remap drive's physical memory address */
66-
mem = devm_ioremap(dev, PALMLD_IDE_PHYS, 0x1000);
65+
mem = devm_platform_ioremap_resource(pdev, 0);
6766
if (!mem)
6867
return -ENOMEM;
6968

0 commit comments

Comments
 (0)