Aneesh Kumar K.V
3e35730dd7
mtd: powernv_flash: Fix device registration error
This change helps me to get multiple mtd device registered. Without this
I get
sysfs: cannot create duplicate filename '/bus/nvmem/devices/flash0'
CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.0.0-rc2-00557-g1ef20ef21f22 #13
Call Trace:
[c0000000b38e3220] [c000000000b58fe4] dump_stack+0xe8/0x164 (unreliable)
[c0000000b38e3270] [c0000000004cf074] sysfs_warn_dup+0x84/0xb0
[c0000000b38e32f0] [c0000000004cf6c4] sysfs_do_create_link_sd.isra.0+0x114/0x150
[c0000000b38e3340] [c000000000726a84] bus_add_device+0x94/0x1e0
[c0000000b38e33c0] [c0000000007218f0] device_add+0x4d0/0x830
[c0000000b38e3480] [c0000000009d54a8] nvmem_register.part.2+0x1c8/0xb30
[c0000000b38e3560] [c000000000834530] mtd_nvmem_add+0x90/0x120
[c0000000b38e3650] [c000000000835bc8] add_mtd_device+0x198/0x4e0
[c0000000b38e36f0] [c00000000083619c] mtd_device_parse_register+0x11c/0x280
[c0000000b38e3780] [c000000000840830] powernv_flash_probe+0x180/0x250
[c0000000b38e3820] [c00000000072c120] platform_drv_probe+0x60/0xf0
[c0000000b38e38a0] [c0000000007283c8] really_probe+0x138/0x4d0
[c0000000b38e3930] [c000000000728acc] driver_probe_device+0x13c/0x1b0
[c0000000b38e39b0] [c000000000728c7c] __driver_attach+0x13c/0x1c0
[c0000000b38e3a30] [c000000000725130] bus_for_each_dev+0xa0/0x120
[c0000000b38e3a90] [c000000000727b2c] driver_attach+0x2c/0x40
[c0000000b38e3ab0] [c0000000007270f8] bus_add_driver+0x228/0x360
[c0000000b38e3b40] [c00000000072a2e0] driver_register+0x90/0x1a0
[c0000000b38e3bb0] [c00000000072c020] __platform_driver_register+0x50/0x70
[c0000000b38e3bd0] [c00000000105c984] powernv_flash_driver_init+0x24/0x38
[c0000000b38e3bf0] [c000000000010904] do_one_initcall+0x84/0x464
[c0000000b38e3cd0] [c000000001004548] kernel_init_freeable+0x530/0x634
[c0000000b38e3db0] [c000000000011154] kernel_init+0x1c/0x168
[c0000000b38e3e20] [c00000000000bed4] ret_from_kernel_thread+0x5c/0x68
mtd mtd1: Failed to register NVMEM device
With the change we now have
root@(none):/sys/bus/nvmem/devices# ls -al
total 0
drwxr-xr-x 2 root root 0 Feb 6 20:49 .
drwxr-xr-x 4 root root 0 Feb 6 20:49 ..
lrwxrwxrwx 1 root root 0 Feb 6 20:49 flash@0 -> ../../../devices/platform/ibm,opal:flash@0/mtd/mtd0/flash@0
lrwxrwxrwx 1 root root 0 Feb 6 20:49 flash@1 -> ../../../devices/platform/ibm,opal:flash@1/mtd/mtd1/flash@1
Fixes: 1cbb4a1c43 ("mtd: powernv: Add powernv flash MTD abstraction driver")
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
2019-02-13 14:19:40 +01:00
..
2019-02-07 12:24:28 +01:00
2019-02-01 15:50:26 +01:00
2019-02-06 12:47:09 -07:00
2019-01-17 11:27:00 -08:00
2018-12-21 21:27:21 +01:00
2019-02-08 10:53:44 -08:00
2019-01-20 09:12:50 +12:00
2018-12-19 13:43:42 +01:00
2018-12-31 17:32:35 -08:00
2018-12-29 08:20:44 -07:00
2019-01-25 13:03:34 -10:00
2019-01-24 11:41:48 -08:00
2019-01-05 09:50:07 -08:00
2019-01-11 10:09:51 +01:00
2019-01-30 22:57:42 +01:00
2019-01-31 23:09:00 -08:00
2018-12-28 12:11:47 -08:00
2019-02-10 10:39:37 -08:00
2019-01-04 13:13:46 -08:00
2019-01-24 17:13:59 +01:00
2019-01-22 20:40:59 -05:00
2019-02-08 16:23:41 -08:00
2019-01-31 16:19:48 +01:00
2019-01-28 15:28:43 +01:00
2019-02-08 10:32:49 +10:00
2019-01-29 12:09:11 +01:00
2019-01-09 19:20:31 -05:00
2019-01-17 12:54:52 -08:00
2019-01-03 11:42:10 -08:00
2018-12-19 20:21:06 +01:00
2019-02-05 13:13:20 +01:00
2019-01-26 11:14:25 +01:00
2019-01-31 08:25:09 -07:00
2019-02-03 13:10:41 +01:00
2019-01-29 13:57:22 -07:00
2019-01-31 23:22:57 -08:00
2019-02-08 15:34:10 -08:00
2019-02-10 09:54:19 -08:00
2019-02-05 16:39:29 -08:00
2019-01-17 22:27:39 +01:00
2018-12-22 14:45:35 -07:00
2019-01-03 18:57:57 -08:00
2018-12-21 22:31:26 -06:00
2019-02-06 17:24:37 -05:00
2019-01-16 11:13:25 -05:00
2019-01-05 11:30:37 -08:00
2018-12-28 16:52:18 -08:00
2018-12-18 23:13:12 -05:00
2019-01-29 10:55:34 +01:00
2019-02-01 15:53:54 +01:00
2019-01-28 12:49:28 +01:00
2019-02-13 14:19:40 +01:00
2019-02-07 18:18:37 -08:00
2019-01-08 07:58:37 -05:00
2019-01-21 09:57:43 -08:00
2019-02-06 16:35:33 +01:00
2019-01-16 12:49:53 -06:00
2019-01-04 12:19:40 +01:00
2018-12-29 13:40:29 -08:00
2019-02-08 15:32:10 -08:00
2019-01-05 11:23:17 -08:00
2019-01-04 10:13:27 +00:00
2019-01-25 12:57:09 -10:00
2019-01-22 10:52:39 +01:00
2019-01-29 10:59:07 +01:00
2019-01-03 18:57:57 -08:00
2018-12-28 20:22:45 -08:00
2018-12-29 13:03:29 -08:00
2019-01-08 16:22:56 -05:00
2018-12-24 12:06:56 +01:00
2019-01-08 07:58:37 -05:00
2018-12-22 00:25:54 +09:00
2018-12-21 13:43:35 +00:00
2019-01-14 20:15:19 -05:00
2019-01-07 16:38:51 +01:00
2019-01-01 13:24:31 -08:00
2019-02-08 11:21:54 -08:00
2018-12-26 10:32:18 -08:00
2019-02-08 15:37:17 -08:00
2019-01-30 11:14:04 +01:00
2019-01-08 07:58:37 -05:00
2019-02-08 10:51:59 -08:00
2019-02-04 21:40:32 -05:00
2018-12-31 13:06:30 -08:00
2019-01-23 16:23:41 +13:00
2019-02-08 10:49:55 -08:00
2018-12-28 20:54:57 -08:00
2019-01-31 09:14:00 +01:00
2019-01-23 08:20:43 -07:00
2019-01-28 22:53:09 -08:00
2019-01-25 12:58:40 -10:00
2019-02-05 15:29:48 -05:00
2018-12-22 00:25:54 +09:00
2019-01-07 10:10:35 +01:00
2019-01-23 22:14:56 +01:00
2018-12-29 13:40:29 -08:00