/* @master: the MTD device to unregister. This will unregister both the master and any partitions if registered.  */
int mtd_device_unregister(struct mtd_info *master)
/* @master: the MTD device to unregister. This will unregister both the master and any partitions if registered.  */
int mtd_device_unregister(struct mtd_info *master)
{
	int err;
	err = del_mtd_partitions(master);
	if (err)
		return err;
	if (!device_is_registered(&master->dev))
		return 0;
	return del_mtd_device(master);
}