Re: [PATCH 03/28] mtd: introduce mtd_erase interface

Mike Frysinger
2011-12-27T09:22:25Z

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