diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-05-24 10:37:38 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-05-24 10:37:38 -0400 |
commit | 62a11ae3405b6da2535d28e5facc2de5af4a7e62 (patch) | |
tree | 6b68f0e74fe08c0e87488ec0653d59c653e46745 /drivers/mtd | |
parent | cedfb2db7b2d6b2c780999536aa1e2650fadee36 (diff) | |
parent | cf9b59e9d3e008591d1f54830f570982bb307a0d (diff) |
Merge branch 'next-devicetree' of git://git.secretlab.ca/git/linux-2.6
* 'next-devicetree' of git://git.secretlab.ca/git/linux-2.6:
of: change of_match_device to work with struct device
of: Remove duplicate fields from of_platform_driver
drivercore: Add of_match_table to the common device drivers
arch/microblaze: Move dma_mask from of_device into pdev_archdata
arch/powerpc: Move dma_mask from of_device into pdev_archdata
of: eliminate of_device->node and dev_archdata->{of,prom}_node
of: Always use 'struct device.of_node' to get device node pointer.
i2c/of: Allow device node to be passed via i2c_board_info
driver-core: Add device node pointer to struct device
of: protect contents of of_platform.h and of_device.h
of/flattree: Make unflatten_device_tree() safe to call from any arch
of/flattree: make of_fdt.h safe to unconditionally include.
Diffstat (limited to 'drivers/mtd')
-rw-r--r-- | drivers/mtd/maps/physmap_of.c | 13 | ||||
-rw-r--r-- | drivers/mtd/maps/sun_uflash.c | 9 | ||||
-rw-r--r-- | drivers/mtd/nand/fsl_elbc_nand.c | 11 | ||||
-rw-r--r-- | drivers/mtd/nand/fsl_upm.c | 7 | ||||
-rw-r--r-- | drivers/mtd/nand/ndfc.c | 15 | ||||
-rw-r--r-- | drivers/mtd/nand/pasemi_nand.c | 9 | ||||
-rw-r--r-- | drivers/mtd/nand/socrates_nand.c | 7 |
7 files changed, 44 insertions, 27 deletions
diff --git a/drivers/mtd/maps/physmap_of.c b/drivers/mtd/maps/physmap_of.c index 36dbcee1ac29..ba124baa646d 100644 --- a/drivers/mtd/maps/physmap_of.c +++ b/drivers/mtd/maps/physmap_of.c | |||
@@ -143,7 +143,7 @@ static int of_flash_remove(struct of_device *dev) | |||
143 | static struct mtd_info * __devinit obsolete_probe(struct of_device *dev, | 143 | static struct mtd_info * __devinit obsolete_probe(struct of_device *dev, |
144 | struct map_info *map) | 144 | struct map_info *map) |
145 | { | 145 | { |
146 | struct device_node *dp = dev->node; | 146 | struct device_node *dp = dev->dev.of_node; |
147 | const char *of_probe; | 147 | const char *of_probe; |
148 | struct mtd_info *mtd; | 148 | struct mtd_info *mtd; |
149 | static const char *rom_probe_types[] | 149 | static const char *rom_probe_types[] |
@@ -221,7 +221,7 @@ static int __devinit of_flash_probe(struct of_device *dev, | |||
221 | #ifdef CONFIG_MTD_PARTITIONS | 221 | #ifdef CONFIG_MTD_PARTITIONS |
222 | const char **part_probe_types; | 222 | const char **part_probe_types; |
223 | #endif | 223 | #endif |
224 | struct device_node *dp = dev->node; | 224 | struct device_node *dp = dev->dev.of_node; |
225 | struct resource res; | 225 | struct resource res; |
226 | struct of_flash *info; | 226 | struct of_flash *info; |
227 | const char *probe_type = match->data; | 227 | const char *probe_type = match->data; |
@@ -245,7 +245,7 @@ static int __devinit of_flash_probe(struct of_device *dev, | |||
245 | p = of_get_property(dp, "reg", &count); | 245 | p = of_get_property(dp, "reg", &count); |
246 | if (count % reg_tuple_size != 0) { | 246 | if (count % reg_tuple_size != 0) { |
247 | dev_err(&dev->dev, "Malformed reg property on %s\n", | 247 | dev_err(&dev->dev, "Malformed reg property on %s\n", |
248 | dev->node->full_name); | 248 | dev->dev.of_node->full_name); |
249 | err = -EINVAL; | 249 | err = -EINVAL; |
250 | goto err_flash_remove; | 250 | goto err_flash_remove; |
251 | } | 251 | } |
@@ -418,8 +418,11 @@ static struct of_device_id of_flash_match[] = { | |||
418 | MODULE_DEVICE_TABLE(of, of_flash_match); | 418 | MODULE_DEVICE_TABLE(of, of_flash_match); |
419 | 419 | ||
420 | static struct of_platform_driver of_flash_driver = { | 420 | static struct of_platform_driver of_flash_driver = { |
421 | .name = "of-flash", | 421 | .driver = { |
422 | .match_table = of_flash_match, | 422 | .name = "of-flash", |
423 | .owner = THIS_MODULE, | ||
424 | .of_match_table = of_flash_match, | ||
425 | }, | ||
423 | .probe = of_flash_probe, | 426 | .probe = of_flash_probe, |
424 | .remove = of_flash_remove, | 427 | .remove = of_flash_remove, |
425 | }; | 428 | }; |
diff --git a/drivers/mtd/maps/sun_uflash.c b/drivers/mtd/maps/sun_uflash.c index fadc4c45b455..0391c2527bd7 100644 --- a/drivers/mtd/maps/sun_uflash.c +++ b/drivers/mtd/maps/sun_uflash.c | |||
@@ -110,7 +110,7 @@ int uflash_devinit(struct of_device *op, struct device_node *dp) | |||
110 | 110 | ||
111 | static int __devinit uflash_probe(struct of_device *op, const struct of_device_id *match) | 111 | static int __devinit uflash_probe(struct of_device *op, const struct of_device_id *match) |
112 | { | 112 | { |
113 | struct device_node *dp = op->node; | 113 | struct device_node *dp = op->dev.of_node; |
114 | 114 | ||
115 | /* Flashprom must have the "user" property in order to | 115 | /* Flashprom must have the "user" property in order to |
116 | * be used by this driver. | 116 | * be used by this driver. |
@@ -149,8 +149,11 @@ static const struct of_device_id uflash_match[] = { | |||
149 | MODULE_DEVICE_TABLE(of, uflash_match); | 149 | MODULE_DEVICE_TABLE(of, uflash_match); |
150 | 150 | ||
151 | static struct of_platform_driver uflash_driver = { | 151 | static struct of_platform_driver uflash_driver = { |
152 | .name = DRIVER_NAME, | 152 | .driver = { |
153 | .match_table = uflash_match, | 153 | .name = DRIVER_NAME, |
154 | .owner = THIS_MODULE, | ||
155 | .of_match_table = uflash_match, | ||
156 | }, | ||
154 | .probe = uflash_probe, | 157 | .probe = uflash_probe, |
155 | .remove = __devexit_p(uflash_remove), | 158 | .remove = __devexit_p(uflash_remove), |
156 | }; | 159 | }; |
diff --git a/drivers/mtd/nand/fsl_elbc_nand.c b/drivers/mtd/nand/fsl_elbc_nand.c index 3f38fb8e6666..5084cc517944 100644 --- a/drivers/mtd/nand/fsl_elbc_nand.c +++ b/drivers/mtd/nand/fsl_elbc_nand.c | |||
@@ -1030,14 +1030,14 @@ static int __devinit fsl_elbc_ctrl_probe(struct of_device *ofdev, | |||
1030 | init_waitqueue_head(&ctrl->controller.wq); | 1030 | init_waitqueue_head(&ctrl->controller.wq); |
1031 | init_waitqueue_head(&ctrl->irq_wait); | 1031 | init_waitqueue_head(&ctrl->irq_wait); |
1032 | 1032 | ||
1033 | ctrl->regs = of_iomap(ofdev->node, 0); | 1033 | ctrl->regs = of_iomap(ofdev->dev.of_node, 0); |
1034 | if (!ctrl->regs) { | 1034 | if (!ctrl->regs) { |
1035 | dev_err(&ofdev->dev, "failed to get memory region\n"); | 1035 | dev_err(&ofdev->dev, "failed to get memory region\n"); |
1036 | ret = -ENODEV; | 1036 | ret = -ENODEV; |
1037 | goto err; | 1037 | goto err; |
1038 | } | 1038 | } |
1039 | 1039 | ||
1040 | ctrl->irq = of_irq_to_resource(ofdev->node, 0, NULL); | 1040 | ctrl->irq = of_irq_to_resource(ofdev->dev.of_node, 0, NULL); |
1041 | if (ctrl->irq == NO_IRQ) { | 1041 | if (ctrl->irq == NO_IRQ) { |
1042 | dev_err(&ofdev->dev, "failed to get irq resource\n"); | 1042 | dev_err(&ofdev->dev, "failed to get irq resource\n"); |
1043 | ret = -ENODEV; | 1043 | ret = -ENODEV; |
@@ -1058,7 +1058,7 @@ static int __devinit fsl_elbc_ctrl_probe(struct of_device *ofdev, | |||
1058 | goto err; | 1058 | goto err; |
1059 | } | 1059 | } |
1060 | 1060 | ||
1061 | for_each_child_of_node(ofdev->node, child) | 1061 | for_each_child_of_node(ofdev->dev.of_node, child) |
1062 | if (of_device_is_compatible(child, "fsl,elbc-fcm-nand")) | 1062 | if (of_device_is_compatible(child, "fsl,elbc-fcm-nand")) |
1063 | fsl_elbc_chip_probe(ctrl, child); | 1063 | fsl_elbc_chip_probe(ctrl, child); |
1064 | 1064 | ||
@@ -1078,9 +1078,10 @@ static const struct of_device_id fsl_elbc_match[] = { | |||
1078 | 1078 | ||
1079 | static struct of_platform_driver fsl_elbc_ctrl_driver = { | 1079 | static struct of_platform_driver fsl_elbc_ctrl_driver = { |
1080 | .driver = { | 1080 | .driver = { |
1081 | .name = "fsl-elbc", | 1081 | .name = "fsl-elbc", |
1082 | .owner = THIS_MODULE, | ||
1083 | .of_match_table = fsl_elbc_match, | ||
1082 | }, | 1084 | }, |
1083 | .match_table = fsl_elbc_match, | ||
1084 | .probe = fsl_elbc_ctrl_probe, | 1085 | .probe = fsl_elbc_ctrl_probe, |
1085 | .remove = fsl_elbc_ctrl_remove, | 1086 | .remove = fsl_elbc_ctrl_remove, |
1086 | }; | 1087 | }; |
diff --git a/drivers/mtd/nand/fsl_upm.c b/drivers/mtd/nand/fsl_upm.c index 2d215ccb564d..00aea6f7d1f1 100644 --- a/drivers/mtd/nand/fsl_upm.c +++ b/drivers/mtd/nand/fsl_upm.c | |||
@@ -360,8 +360,11 @@ static const struct of_device_id of_fun_match[] = { | |||
360 | MODULE_DEVICE_TABLE(of, of_fun_match); | 360 | MODULE_DEVICE_TABLE(of, of_fun_match); |
361 | 361 | ||
362 | static struct of_platform_driver of_fun_driver = { | 362 | static struct of_platform_driver of_fun_driver = { |
363 | .name = "fsl,upm-nand", | 363 | .driver = { |
364 | .match_table = of_fun_match, | 364 | .name = "fsl,upm-nand", |
365 | .owner = THIS_MODULE, | ||
366 | .of_match_table = of_fun_match, | ||
367 | }, | ||
365 | .probe = fun_probe, | 368 | .probe = fun_probe, |
366 | .remove = __devexit_p(fun_remove), | 369 | .remove = __devexit_p(fun_remove), |
367 | }; | 370 | }; |
diff --git a/drivers/mtd/nand/ndfc.c b/drivers/mtd/nand/ndfc.c index b983cae8c298..98fd2bdf8be1 100644 --- a/drivers/mtd/nand/ndfc.c +++ b/drivers/mtd/nand/ndfc.c | |||
@@ -239,14 +239,14 @@ static int __devinit ndfc_probe(struct of_device *ofdev, | |||
239 | dev_set_drvdata(&ofdev->dev, ndfc); | 239 | dev_set_drvdata(&ofdev->dev, ndfc); |
240 | 240 | ||
241 | /* Read the reg property to get the chip select */ | 241 | /* Read the reg property to get the chip select */ |
242 | reg = of_get_property(ofdev->node, "reg", &len); | 242 | reg = of_get_property(ofdev->dev.of_node, "reg", &len); |
243 | if (reg == NULL || len != 12) { | 243 | if (reg == NULL || len != 12) { |
244 | dev_err(&ofdev->dev, "unable read reg property (%d)\n", len); | 244 | dev_err(&ofdev->dev, "unable read reg property (%d)\n", len); |
245 | return -ENOENT; | 245 | return -ENOENT; |
246 | } | 246 | } |
247 | ndfc->chip_select = reg[0]; | 247 | ndfc->chip_select = reg[0]; |
248 | 248 | ||
249 | ndfc->ndfcbase = of_iomap(ofdev->node, 0); | 249 | ndfc->ndfcbase = of_iomap(ofdev->dev.of_node, 0); |
250 | if (!ndfc->ndfcbase) { | 250 | if (!ndfc->ndfcbase) { |
251 | dev_err(&ofdev->dev, "failed to get memory\n"); | 251 | dev_err(&ofdev->dev, "failed to get memory\n"); |
252 | return -EIO; | 252 | return -EIO; |
@@ -255,20 +255,20 @@ static int __devinit ndfc_probe(struct of_device *ofdev, | |||
255 | ccr = NDFC_CCR_BS(ndfc->chip_select); | 255 | ccr = NDFC_CCR_BS(ndfc->chip_select); |
256 | 256 | ||
257 | /* It is ok if ccr does not exist - just default to 0 */ | 257 | /* It is ok if ccr does not exist - just default to 0 */ |
258 | reg = of_get_property(ofdev->node, "ccr", NULL); | 258 | reg = of_get_property(ofdev->dev.of_node, "ccr", NULL); |
259 | if (reg) | 259 | if (reg) |
260 | ccr |= *reg; | 260 | ccr |= *reg; |
261 | 261 | ||
262 | out_be32(ndfc->ndfcbase + NDFC_CCR, ccr); | 262 | out_be32(ndfc->ndfcbase + NDFC_CCR, ccr); |
263 | 263 | ||
264 | /* Set the bank settings if given */ | 264 | /* Set the bank settings if given */ |
265 | reg = of_get_property(ofdev->node, "bank-settings", NULL); | 265 | reg = of_get_property(ofdev->dev.of_node, "bank-settings", NULL); |
266 | if (reg) { | 266 | if (reg) { |
267 | int offset = NDFC_BCFG0 + (ndfc->chip_select << 2); | 267 | int offset = NDFC_BCFG0 + (ndfc->chip_select << 2); |
268 | out_be32(ndfc->ndfcbase + offset, *reg); | 268 | out_be32(ndfc->ndfcbase + offset, *reg); |
269 | } | 269 | } |
270 | 270 | ||
271 | err = ndfc_chip_init(ndfc, ofdev->node); | 271 | err = ndfc_chip_init(ndfc, ofdev->dev.of_node); |
272 | if (err) { | 272 | if (err) { |
273 | iounmap(ndfc->ndfcbase); | 273 | iounmap(ndfc->ndfcbase); |
274 | return err; | 274 | return err; |
@@ -294,9 +294,10 @@ MODULE_DEVICE_TABLE(of, ndfc_match); | |||
294 | 294 | ||
295 | static struct of_platform_driver ndfc_driver = { | 295 | static struct of_platform_driver ndfc_driver = { |
296 | .driver = { | 296 | .driver = { |
297 | .name = "ndfc", | 297 | .name = "ndfc", |
298 | .owner = THIS_MODULE, | ||
299 | .of_match_table = ndfc_match, | ||
298 | }, | 300 | }, |
299 | .match_table = ndfc_match, | ||
300 | .probe = ndfc_probe, | 301 | .probe = ndfc_probe, |
301 | .remove = __devexit_p(ndfc_remove), | 302 | .remove = __devexit_p(ndfc_remove), |
302 | }; | 303 | }; |
diff --git a/drivers/mtd/nand/pasemi_nand.c b/drivers/mtd/nand/pasemi_nand.c index 090a05c12cbe..f02af24d033a 100644 --- a/drivers/mtd/nand/pasemi_nand.c +++ b/drivers/mtd/nand/pasemi_nand.c | |||
@@ -93,7 +93,7 @@ static int __devinit pasemi_nand_probe(struct of_device *ofdev, | |||
93 | const struct of_device_id *match) | 93 | const struct of_device_id *match) |
94 | { | 94 | { |
95 | struct pci_dev *pdev; | 95 | struct pci_dev *pdev; |
96 | struct device_node *np = ofdev->node; | 96 | struct device_node *np = ofdev->dev.of_node; |
97 | struct resource res; | 97 | struct resource res; |
98 | struct nand_chip *chip; | 98 | struct nand_chip *chip; |
99 | int err = 0; | 99 | int err = 0; |
@@ -221,8 +221,11 @@ MODULE_DEVICE_TABLE(of, pasemi_nand_match); | |||
221 | 221 | ||
222 | static struct of_platform_driver pasemi_nand_driver = | 222 | static struct of_platform_driver pasemi_nand_driver = |
223 | { | 223 | { |
224 | .name = (char*)driver_name, | 224 | .driver = { |
225 | .match_table = pasemi_nand_match, | 225 | .name = (char*)driver_name, |
226 | .owner = THIS_MODULE, | ||
227 | .of_match_table = pasemi_nand_match, | ||
228 | }, | ||
226 | .probe = pasemi_nand_probe, | 229 | .probe = pasemi_nand_probe, |
227 | .remove = pasemi_nand_remove, | 230 | .remove = pasemi_nand_remove, |
228 | }; | 231 | }; |
diff --git a/drivers/mtd/nand/socrates_nand.c b/drivers/mtd/nand/socrates_nand.c index b37cbde6e7db..884852dc7eb4 100644 --- a/drivers/mtd/nand/socrates_nand.c +++ b/drivers/mtd/nand/socrates_nand.c | |||
@@ -301,8 +301,11 @@ static const struct of_device_id socrates_nand_match[] = | |||
301 | MODULE_DEVICE_TABLE(of, socrates_nand_match); | 301 | MODULE_DEVICE_TABLE(of, socrates_nand_match); |
302 | 302 | ||
303 | static struct of_platform_driver socrates_nand_driver = { | 303 | static struct of_platform_driver socrates_nand_driver = { |
304 | .name = "socrates_nand", | 304 | .driver = { |
305 | .match_table = socrates_nand_match, | 305 | .name = "socrates_nand", |
306 | .owner = THIS_MODULE, | ||
307 | .of_match_table = socrates_nand_match, | ||
308 | }, | ||
306 | .probe = socrates_nand_probe, | 309 | .probe = socrates_nand_probe, |
307 | .remove = __devexit_p(socrates_nand_remove), | 310 | .remove = __devexit_p(socrates_nand_remove), |
308 | }; | 311 | }; |