[PATCH V2] mtd: basic (read only) driver for BCMA serial flash

Artem Bityutskiy dedekind1 at gmail.com
Tue Sep 11 06:20:40 EDT 2012


On Mon, 2012-09-03 at 21:07 +0200, Rafał Miłecki wrote:
> This registers MTD driver for serial flash platform device. Right now it
> supports reading only, writing still has to be implemented.
> At this point it's marked as BROKEN, because it requires code present in
> net tree that wasn't mainlined yet.
> 
> Signed-off-by: Rafał Miłecki <zajec5 at gmail.com>

What are exactly the changes it depends on? URL? Are they staged for
3.7?

> +static void bcm47xxsflash_fill_mtd(struct bcma_sflash *sflash,
> +				   struct mtd_info *mtd)
> +{
> +	mtd->priv = sflash;
> +	mtd->name = "bcm47xxsflash";
> +	mtd->owner = THIS_MODULE;
> +	mtd->type = MTD_ROM;
> +	mtd->size = sflash->size;
> +	mtd->_read = bcm47xxsflash_read;

I guess also
mtd->flags = MTD_CAP_ROM;
would be good to add.

> +	mtd->writesize = 1; /* FIXME */

Is "FIXME" needed? Why? If needed, write a more descriptive comment.

Also I guess
mtd->writebufsize = mtd->writesize;

> +static int __devexit bcm47xxsflash_remove(struct platform_device *pdev)
> +{
> +	struct bcma_sflash *sflash = dev_get_platdata(&pdev->dev);
> +
> +	if (!sflash->mtd) {
> +		WARN_ON(1);
> +		return -ENODEV;
> +	}

Why do you need this check with a warning? Can this happen, in which
cases?

-- 
Best Regards,
Artem Bityutskiy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part
URL: <http://lists.infradead.org/pipermail/linux-mtd/attachments/20120911/64de47e0/attachment-0001.sig>


More information about the linux-mtd mailing list