[PATCH] mtd: mchp23k256: Add driver for this SPI SRAM device

Rafał Miłecki zajec5 at gmail.com
Tue Mar 7 22:47:55 PST 2017


On 03/06/2017 06:58 PM, Andrew Lunn wrote:
> diff --git a/drivers/mtd/devices/mchp23k256.c b/drivers/mtd/devices/mchp23k256.c
> new file mode 100644
> index 000000000000..482a101fe887
> --- /dev/null
> +++ b/drivers/mtd/devices/mchp23k256.c
> @@ -0,0 +1,183 @@
> +/*
> + * mchp23k256.c
> + *
> + * Driver for Microchip 23k256 SPI RAM chips
> + *
> + * Copyright © 20016 Andrew Lunn <andrew at lunn.ch>
> + *
> + * This code is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> + *
> + */

So is this driver GPL v2 licensed?


> +/* Set the device into sequential mode. This allows read/writes to
> + * the entire SRAM in a single operation
> + */
> +static int mchp23k256_set_mode(struct spi_device *spi)
> +{
> +	struct spi_transfer transfer = {};
> +	struct spi_message message;
> +	unsigned char command[2];
> +
> +	spi_message_init(&message);
> +
> +	command[0] = MCHP23K256_CMD_WRITE_STATUS;
> +	command[1] = MCHP23K256_MODE_SEQ;
> +
> +	transfer.tx_buf = command;
> +	transfer.len = sizeof(command);
> +	spi_message_add_tail(&transfer, &message);
> +
> +	return spi_sync(spi, &message);
> +}
> +
> +
> +
> +static int mchp23k256_probe(struct spi_device *spi)

Just one empty line between functions please.


> +MODULE_DESCRIPTION("MTD SPI driver for MCHP23K256 RAM chips");
> +MODULE_AUTHOR("Andrew Lunn <andre at lunn.ch>");
> +MODULE_LICENSE("GPL");
> +MODULE_ALIAS("spi:mchp23k256");

Or is it GPL v2 or later? Please pick one and be consistent.



More information about the linux-mtd mailing list