remarkable-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
devices Merge branch 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm 2017-02-28 11:50:53 -08:00
lpddr
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
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
ar7part.c
bcm47xxpart.c mtd: bcm47xxpart: support layouts with multiple TRX partitions 2017-02-09 18:59:45 -08:00
bcm63xxpart.c
cmdlinepart.c
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
Makefile
mtd_blkdevs.c block: fold cmd_type into the REQ_OP_ space 2017-01-31 14:00:44 -07:00
mtdblock.c
mtdblock_ro.c
mtdchar.c mtd: Fix typo: "occured" -> "occurred" 2017-02-08 14:24:57 -08:00
mtdconcat.c
mtdcore.c mtd: fix typos in ooblayout comment blocks 2017-02-08 13:32:08 -08:00
mtdcore.h
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
ofpart.c mtd: Add partition device node to mtd partition devices 2017-02-09 19:19:25 -08:00
redboot.c
rfd_ftl.c
sm_ftl.c
sm_ftl.h
ssfdc.c