Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5e472128 authored by Brian Norris's avatar Brian Norris
Browse files

mtd: remove dead non-char logic



MTD used to allow compiling out character device support. This was
dropped in the following commit, but some of the accompanying logic was
never dropped:

  commit 660685d9
  Author: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
  Date:   Thu Mar 14 13:27:40 2013 +0200

      mtd: merge mtdchar module with mtdcore

The weird logic was flagged by Coverity.

Signed-off-by: default avatarBrian Norris <computersforpeace@gmail.com>
Cc: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
parent f7f0d358
Loading
Loading
Loading
Loading
+5 −8
Original line number Diff line number Diff line
@@ -105,11 +105,10 @@ static LIST_HEAD(mtd_notifiers);
 */
static void mtd_release(struct device *dev)
{
	struct mtd_info __maybe_unused *mtd = dev_get_drvdata(dev);
	struct mtd_info *mtd = dev_get_drvdata(dev);
	dev_t index = MTD_DEVT(mtd->index);

	/* remove /dev/mtdXro node if needed */
	if (index)
	/* remove /dev/mtdXro node */
	device_destroy(&mtd_class, index + 1);
}

@@ -442,10 +441,8 @@ int add_mtd_device(struct mtd_info *mtd)
	if (device_register(&mtd->dev) != 0)
		goto fail_added;

	if (MTD_DEVT(i))
		device_create(&mtd_class, mtd->dev.parent,
			      MTD_DEVT(i) + 1,
			      NULL, "mtd%dro", i);
	device_create(&mtd_class, mtd->dev.parent, MTD_DEVT(i) + 1, NULL,
		      "mtd%dro", i);

	pr_debug("mtd: Giving out device %d to %s\n", i, mtd->name);
	/* No need to get a refcount on the module containing