[PATCH v2 2/4] mtd: nand: convert printk() to pr_*()

Brian Norris computersforpeace at gmail.com
Wed Jul 6 15:12:39 EDT 2011


On Wed, Jul 6, 2011 at 11:51 AM, Brian Norris
<computersforpeace at gmail.com> wrote:
> static inline struct device *mtd_to_dev(struct mtd_info *mtd)
> {
>        return mtd ? mtd->dev.parent : NULL;
> }

Second thought on this function; we may not even need to worry about
the "mtd == NULL" case. But we might want to handle the case that
mtd->dev actually *is* registered properly:

static inline struct device *mtd_to_dev(struct mtd_info *mtd)
{
        if (device_is_registered(&mtd->dev))
                return &mtd->dev;
        return mtd->dev.parent;
}

Brian



More information about the linux-mtd mailing list