[PATCH 03/28] mtd: introduce mtd_erase interface

Mike Frysinger vapier.adi at gmail.com
Tue Dec 27 04:22:01 EST 2011


On Fri, Dec 23, 2011 at 13:10, Artem Bityutskiy wrote:
>  static inline struct mtd_info *dev_to_mtd(struct device *dev)
>  {
>        return dev ? dev_get_drvdata(dev) : NULL;

on an unrelated note, this NULL check is unnecessary.  the core func
already takes care of checking the pointer.

drivers/base/dd.c:
408 void *dev_get_drvdata(const struct device *dev)
409 {
410         if (dev && dev->p)
411                 return dev->p->driver_data;
412         return NULL;
413 }
-mike



More information about the linux-mtd mailing list