diff options
Diffstat (limited to 'drivers/mtd/maps/physmap.c')
-rw-r--r-- | drivers/mtd/maps/physmap.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/mtd/maps/physmap.c b/drivers/mtd/maps/physmap.c index 426461a5f0d4..4c18b98a3110 100644 --- a/drivers/mtd/maps/physmap.c +++ b/drivers/mtd/maps/physmap.c | |||
@@ -106,12 +106,12 @@ static int physmap_flash_probe(struct platform_device *dev) | |||
106 | 106 | ||
107 | for (i = 0; i < dev->num_resources; i++) { | 107 | for (i = 0; i < dev->num_resources; i++) { |
108 | printk(KERN_NOTICE "physmap platform flash device: %.8llx at %.8llx\n", | 108 | printk(KERN_NOTICE "physmap platform flash device: %.8llx at %.8llx\n", |
109 | (unsigned long long)(dev->resource[i].end - dev->resource[i].start + 1), | 109 | (unsigned long long)resource_size(&dev->resource[i]), |
110 | (unsigned long long)dev->resource[i].start); | 110 | (unsigned long long)dev->resource[i].start); |
111 | 111 | ||
112 | if (!devm_request_mem_region(&dev->dev, | 112 | if (!devm_request_mem_region(&dev->dev, |
113 | dev->resource[i].start, | 113 | dev->resource[i].start, |
114 | dev->resource[i].end - dev->resource[i].start + 1, | 114 | resource_size(&dev->resource[i]), |
115 | dev_name(&dev->dev))) { | 115 | dev_name(&dev->dev))) { |
116 | dev_err(&dev->dev, "Could not reserve memory region\n"); | 116 | dev_err(&dev->dev, "Could not reserve memory region\n"); |
117 | err = -ENOMEM; | 117 | err = -ENOMEM; |
@@ -120,7 +120,7 @@ static int physmap_flash_probe(struct platform_device *dev) | |||
120 | 120 | ||
121 | info->map[i].name = dev_name(&dev->dev); | 121 | info->map[i].name = dev_name(&dev->dev); |
122 | info->map[i].phys = dev->resource[i].start; | 122 | info->map[i].phys = dev->resource[i].start; |
123 | info->map[i].size = dev->resource[i].end - dev->resource[i].start + 1; | 123 | info->map[i].size = resource_size(&dev->resource[i]); |
124 | info->map[i].bankwidth = physmap_data->width; | 124 | info->map[i].bankwidth = physmap_data->width; |
125 | info->map[i].set_vpp = physmap_data->set_vpp; | 125 | info->map[i].set_vpp = physmap_data->set_vpp; |
126 | info->map[i].pfow_base = physmap_data->pfow_base; | 126 | info->map[i].pfow_base = physmap_data->pfow_base; |
@@ -136,8 +136,12 @@ static int physmap_flash_probe(struct platform_device *dev) | |||
136 | simple_map_init(&info->map[i]); | 136 | simple_map_init(&info->map[i]); |
137 | 137 | ||
138 | probe_type = rom_probe_types; | 138 | probe_type = rom_probe_types; |
139 | for (; info->mtd[i] == NULL && *probe_type != NULL; probe_type++) | 139 | if (physmap_data->probe_type == NULL) { |
140 | info->mtd[i] = do_map_probe(*probe_type, &info->map[i]); | 140 | for (; info->mtd[i] == NULL && *probe_type != NULL; probe_type++) |
141 | info->mtd[i] = do_map_probe(*probe_type, &info->map[i]); | ||
142 | } else | ||
143 | info->mtd[i] = do_map_probe(physmap_data->probe_type, &info->map[i]); | ||
144 | |||
141 | if (info->mtd[i] == NULL) { | 145 | if (info->mtd[i] == NULL) { |
142 | dev_err(&dev->dev, "map_probe failed\n"); | 146 | dev_err(&dev->dev, "map_probe failed\n"); |
143 | err = -ENXIO; | 147 | err = -ENXIO; |