alistair23-linux/drivers/mtd
Logan Gunthorpe 493cfaeaa0 mtd: utilize new cdev_device_add helper function
This is not as straightforward a conversion as the others
in this series. These drivers did not originally make use of
kobj.parent so they likely suffered from a use after free bug if
someone unregistered the devices while they are being used.

In order to make the conversions, switch from device_register
to device_initialize / cdev_device_add.

In build.c, this patch unwinds a complicated mess of extra
get_device/put_devices and reference tracking by moving device_initialize
early in the attach process. Then it always uses put_device and instead of
using device_unregister and extra get_devices everywhere we just use
cdev_device_del and one put_device once everything is completely done.
This simplifies things dramatically and makes it easier to reason about.

In vmt.c, the patch pushes device initialization up to the beginning of the
device creation and then that function only needs to use put_device
in the error path which simplifies things a good deal.

Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-21 06:44:33 +01:00
..
chips mtd: cfi_cmdset_0020: Deinline do_write_buffer, save 5316 bytes 2016-07-09 18:53:33 -07:00
devices Merge branch 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm 2017-02-28 11:50:53 -08:00
lpddr mtd: lpddr: show parent device in sysfs 2015-10-13 09:21:17 -07:00
maps mtd: physmap_of: fixup gemini/versatile dependencies 2017-02-10 09:53:41 -08:00
nand sched/headers: Prepare for new header dependencies before moving code to <linux/sched/task_stack.h> 2017-03-02 08:42:36 +01:00
onenand mtd: silence some uninitialized variable warnings 2016-07-09 18:14:39 -07:00
spi-nor scripts/spelling.txt: add "disble(d)" pattern and fix typo instances 2017-03-09 17:01:09 -08:00
tests sched/headers: Prepare to move signal wakeup & sigpending methods from <linux/sched.h> into <linux/sched/signal.h> 2017-03-02 08:42:32 +01:00
ubi mtd: utilize new cdev_device_add helper function 2017-03-21 06:44:33 +01:00
afs.c mtd: partitions: make parsers return 'const' partition arrays 2015-12-09 10:21:57 -08:00
ar7part.c mtd: partitions: make parsers return 'const' partition arrays 2015-12-09 10:21:57 -08:00
bcm47xxpart.c mtd: bcm47xxpart: support layouts with multiple TRX partitions 2017-02-09 18:59:45 -08:00
bcm63xxpart.c mtd: bcm63xxpart: give width specifier an 'int', not 'size_t' 2016-03-07 13:13:58 -08:00
cmdlinepart.c mtd: partitions: make parsers return 'const' partition arrays 2015-12-09 10:21:57 -08:00
ftl.c Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
inftlcore.c Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
inftlmount.c Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
Kconfig mtd: bcm63xxpart: Remove dependency on mach-bcm63xx 2016-02-12 10:27:48 -08:00
Makefile mtd: spi-nor: shorten Kconfig naming 2014-04-14 11:23:01 -07:00
mtd_blkdevs.c block: fold cmd_type into the REQ_OP_ space 2017-01-31 14:00:44 -07:00
mtdblock.c mtd: mtdblock: remove the needless mtdblks_lock 2015-01-07 12:51:56 -08:00
mtdblock_ro.c
mtdchar.c mtd: Fix typo: "occured" -> "occurred" 2017-02-08 14:24:57 -08:00
mtdconcat.c mtd: create an mtd_ooblayout_ops struct to ease ECC layout definition 2016-04-19 22:05:55 +02:00
mtdcore.c mtd: fix typos in ooblayout comment blocks 2017-02-08 13:32:08 -08:00
mtdcore.h mtd: partitions: support a cleanup callback for parsers 2015-12-09 14:57:44 -08:00
mtdoops.c
mtdpart.c mtd: Add partition device node to mtd partition devices 2017-02-09 19:19:25 -08:00
mtdsuper.c
mtdswap.c mtd: mtdswap: fix spelling mistake "erassure" -> "erasure" 2016-11-22 11:43:52 -08:00
nftlcore.c Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
nftlmount.c mtd: nftl: reorganize operations in condition check 2015-01-09 15:26:29 -08:00
ofpart.c mtd: Add partition device node to mtd partition devices 2017-02-09 19:19:25 -08:00
redboot.c mtd: partitions: make parsers return 'const' partition arrays 2015-12-09 10:21:57 -08:00
rfd_ftl.c mtd: remove some duplicative checks 2014-03-10 22:42:25 -07:00
sm_ftl.c treewide: Fix typos in printk 2016-04-18 11:23:24 +02:00
sm_ftl.h
ssfdc.c mtd: Replace if and BUG with BUG_ON 2016-07-09 18:48:54 -07:00