This is a note to let you know that I've just added the patch titled gpio: mcp23s08: handle default gpio base to the 3.18-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: gpio-mcp23s08-handle-default-gpio-base.patch and it can be found in the queue-3.18 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From b184c388f773f30b6c707d3d4599b2db80f4390c Mon Sep 17 00:00:00 2001 From: Sonic Zhang <sonic.zhang@xxxxxxxxxx> Date: Tue, 20 Jan 2015 17:00:08 +0800 Subject: gpio: mcp23s08: handle default gpio base From: Sonic Zhang <sonic.zhang@xxxxxxxxxx> commit b184c388f773f30b6c707d3d4599b2db80f4390c upstream. Create default gpio base if neither device node nor platform data is defined. Signed-off-by: Sonic Zhang <sonic.zhang@xxxxxxxxxx> Reviewed-by: Alexandre Courbot <acourbot@xxxxxxxxxx> Tested-by: Antonio Fiol <antonio@xxxxxxx> Signed-off-by: Linus Walleij <linus.walleij@xxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/gpio/gpio-mcp23s08.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) --- a/drivers/gpio/gpio-mcp23s08.c +++ b/drivers/gpio/gpio-mcp23s08.c @@ -785,9 +785,11 @@ static int mcp230xx_probe(struct i2c_cli client->irq = irq_of_parse_and_map(client->dev.of_node, 0); } else { pdata = dev_get_platdata(&client->dev); - if (!pdata || !gpio_is_valid(pdata->base)) { - dev_dbg(&client->dev, "invalid platform data\n"); - return -EINVAL; + if (!pdata) { + pdata = devm_kzalloc(&client->dev, + sizeof(struct mcp23s08_platform_data), + GFP_KERNEL); + pdata->base = -1; } } @@ -908,10 +910,11 @@ static int mcp23s08_probe(struct spi_dev } else { type = spi_get_device_id(spi)->driver_data; pdata = dev_get_platdata(&spi->dev); - if (!pdata || !gpio_is_valid(pdata->base)) { - dev_dbg(&spi->dev, - "invalid or missing platform data\n"); - return -EINVAL; + if (!pdata) { + pdata = devm_kzalloc(&spi->dev, + sizeof(struct mcp23s08_platform_data), + GFP_KERNEL); + pdata->base = -1; } for (addr = 0; addr < ARRAY_SIZE(pdata->chip); addr++) { Patches currently in stable-queue which might be from sonic.zhang@xxxxxxxxxx are queue-3.18/gpio-mcp23s08-handle-default-gpio-base.patch -- To unsubscribe from this list: send the line "unsubscribe stable" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html