|
@@ -12,7 +12,6 @@
|
|
#include <linux/init.h>
|
|
#include <linux/init.h>
|
|
#include <linux/mutex.h>
|
|
#include <linux/mutex.h>
|
|
#include <linux/spi/spi.h>
|
|
#include <linux/spi/spi.h>
|
|
-#include <linux/spi/74x164.h>
|
|
|
|
#include <linux/gpio.h>
|
|
#include <linux/gpio.h>
|
|
#include <linux/of_gpio.h>
|
|
#include <linux/of_gpio.h>
|
|
#include <linux/slab.h>
|
|
#include <linux/slab.h>
|
|
@@ -108,14 +107,8 @@ static int gen_74x164_direction_output(struct gpio_chip *gc,
|
|
static int gen_74x164_probe(struct spi_device *spi)
|
|
static int gen_74x164_probe(struct spi_device *spi)
|
|
{
|
|
{
|
|
struct gen_74x164_chip *chip;
|
|
struct gen_74x164_chip *chip;
|
|
- struct gen_74x164_chip_platform_data *pdata;
|
|
|
|
int ret;
|
|
int ret;
|
|
|
|
|
|
- if (!spi->dev.of_node) {
|
|
|
|
- dev_err(&spi->dev, "No device tree data available.\n");
|
|
|
|
- return -EINVAL;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
/*
|
|
/*
|
|
* bits_per_word cannot be configured in platform data
|
|
* bits_per_word cannot be configured in platform data
|
|
*/
|
|
*/
|
|
@@ -129,12 +122,6 @@ static int gen_74x164_probe(struct spi_device *spi)
|
|
if (!chip)
|
|
if (!chip)
|
|
return -ENOMEM;
|
|
return -ENOMEM;
|
|
|
|
|
|
- pdata = dev_get_platdata(&spi->dev);
|
|
|
|
- if (pdata && pdata->base)
|
|
|
|
- chip->gpio_chip.base = pdata->base;
|
|
|
|
- else
|
|
|
|
- chip->gpio_chip.base = -1;
|
|
|
|
-
|
|
|
|
mutex_init(&chip->lock);
|
|
mutex_init(&chip->lock);
|
|
|
|
|
|
spi_set_drvdata(spi, chip);
|
|
spi_set_drvdata(spi, chip);
|
|
@@ -145,6 +132,7 @@ static int gen_74x164_probe(struct spi_device *spi)
|
|
chip->gpio_chip.direction_output = gen_74x164_direction_output;
|
|
chip->gpio_chip.direction_output = gen_74x164_direction_output;
|
|
chip->gpio_chip.get = gen_74x164_get_value;
|
|
chip->gpio_chip.get = gen_74x164_get_value;
|
|
chip->gpio_chip.set = gen_74x164_set_value;
|
|
chip->gpio_chip.set = gen_74x164_set_value;
|
|
|
|
+ chip->gpio_chip.base = -1;
|
|
|
|
|
|
if (of_property_read_u32(spi->dev.of_node, "registers-number", &chip->registers)) {
|
|
if (of_property_read_u32(spi->dev.of_node, "registers-number", &chip->registers)) {
|
|
dev_err(&spi->dev, "Missing registers-number property in the DT.\n");
|
|
dev_err(&spi->dev, "Missing registers-number property in the DT.\n");
|