]> git.baikalelectronics.ru Git - kernel.git/commit
mtd: nand: register orion_nand using platform_driver_probe()
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Fri, 18 Sep 2009 19:51:43 +0000 (12:51 -0700)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Sat, 19 Sep 2009 18:06:30 +0000 (11:06 -0700)
commitcc56df91b3a795061ab10e9eb626e1371c1c0055
treed4aa7c13c000240f5d914b8995ea07d8dd06929f
parent3884cc44c4b8917e304b4bd14bada68484ed9e17
mtd: nand: register orion_nand using platform_driver_probe()

orion_nand_probe lives in .init.text, so using platform_driver_register to
register it is wrong because binding a device after the init memory is
discarded (e.g.  via sysfs) results in an oops.

As requested by Nicolas Pitre platform_driver_probe is used instead of
moving the probe function to .devinit.text as proposed initially.  This
saves some memory, but devices registered after the driver is probed are
not bound (probably there are none) and binding via sysfs isn't possible.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Lennert Buytenhek <buytenh@marvell.com>
Cc: Saeed Bishara <saeed@marvell.com>
Cc: Joern Engel <joern@logfs.org>
Acked-by: Nicolas Pitre <nico@marvell.com>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
drivers/mtd/nand/orion_nand.c