You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
gpio: use dev_get_platdata()
Use the wrapper function for retrieving the platform data instead of accessing dev->platform_data directly. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
This commit is contained in:
committed by
Linus Walleij
parent
c0e811d9f5
commit
e56aee1897
@@ -129,7 +129,7 @@ static int gen_74x164_probe(struct spi_device *spi)
|
||||
if (!chip)
|
||||
return -ENOMEM;
|
||||
|
||||
pdata = spi->dev.platform_data;
|
||||
pdata = dev_get_platdata(&spi->dev);
|
||||
if (pdata && pdata->base)
|
||||
chip->gpio_chip.base = pdata->base;
|
||||
else
|
||||
|
||||
@@ -89,7 +89,7 @@ static int adp5520_gpio_direction_output(struct gpio_chip *chip,
|
||||
|
||||
static int adp5520_gpio_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct adp5520_gpio_platform_data *pdata = pdev->dev.platform_data;
|
||||
struct adp5520_gpio_platform_data *pdata = dev_get_platdata(&pdev->dev);
|
||||
struct adp5520_gpio *dev;
|
||||
struct gpio_chip *gc;
|
||||
int ret, i, gpios;
|
||||
|
||||
@@ -276,7 +276,8 @@ static irqreturn_t adp5588_irq_handler(int irq, void *devid)
|
||||
static int adp5588_irq_setup(struct adp5588_gpio *dev)
|
||||
{
|
||||
struct i2c_client *client = dev->client;
|
||||
struct adp5588_gpio_platform_data *pdata = client->dev.platform_data;
|
||||
struct adp5588_gpio_platform_data *pdata =
|
||||
dev_get_platdata(&client->dev);
|
||||
unsigned gpio;
|
||||
int ret;
|
||||
|
||||
@@ -349,7 +350,8 @@ static void adp5588_irq_teardown(struct adp5588_gpio *dev)
|
||||
static int adp5588_gpio_probe(struct i2c_client *client,
|
||||
const struct i2c_device_id *id)
|
||||
{
|
||||
struct adp5588_gpio_platform_data *pdata = client->dev.platform_data;
|
||||
struct adp5588_gpio_platform_data *pdata =
|
||||
dev_get_platdata(&client->dev);
|
||||
struct adp5588_gpio *dev;
|
||||
struct gpio_chip *gc;
|
||||
int ret, i, revid;
|
||||
@@ -440,7 +442,8 @@ err:
|
||||
|
||||
static int adp5588_gpio_remove(struct i2c_client *client)
|
||||
{
|
||||
struct adp5588_gpio_platform_data *pdata = client->dev.platform_data;
|
||||
struct adp5588_gpio_platform_data *pdata =
|
||||
dev_get_platdata(&client->dev);
|
||||
struct adp5588_gpio *dev = i2c_get_clientdata(client);
|
||||
int ret;
|
||||
|
||||
|
||||
@@ -97,7 +97,7 @@ static struct gpio_chip template_chip = {
|
||||
static int arizona_gpio_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct arizona *arizona = dev_get_drvdata(pdev->dev.parent);
|
||||
struct arizona_pdata *pdata = arizona->dev->platform_data;
|
||||
struct arizona_pdata *pdata = dev_get_platdata(arizona->dev);
|
||||
struct arizona_gpio *arizona_gpio;
|
||||
int ret;
|
||||
|
||||
|
||||
@@ -216,7 +216,7 @@ static int da9052_gpio_probe(struct platform_device *pdev)
|
||||
return -ENOMEM;
|
||||
|
||||
gpio->da9052 = dev_get_drvdata(pdev->dev.parent);
|
||||
pdata = gpio->da9052->dev->platform_data;
|
||||
pdata = dev_get_platdata(gpio->da9052->dev);
|
||||
|
||||
gpio->gp = reference_gp;
|
||||
if (pdata && pdata->gpio_base)
|
||||
|
||||
@@ -150,7 +150,7 @@ static int da9055_gpio_probe(struct platform_device *pdev)
|
||||
return -ENOMEM;
|
||||
|
||||
gpio->da9055 = dev_get_drvdata(pdev->dev.parent);
|
||||
pdata = gpio->da9055->dev->platform_data;
|
||||
pdata = dev_get_platdata(gpio->da9055->dev);
|
||||
|
||||
gpio->gp = reference_gp;
|
||||
if (pdata && pdata->gpio_base)
|
||||
|
||||
@@ -253,7 +253,7 @@ static struct irq_domain_ops em_gio_irq_domain_ops = {
|
||||
static int em_gio_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct gpio_em_config pdata_dt;
|
||||
struct gpio_em_config *pdata = pdev->dev.platform_data;
|
||||
struct gpio_em_config *pdata = dev_get_platdata(&pdev->dev);
|
||||
struct em_gio_priv *p;
|
||||
struct resource *io[2], *irq[2];
|
||||
struct gpio_chip *gpio_chip;
|
||||
|
||||
@@ -354,7 +354,7 @@ static int ichx_gpio_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct resource *res_base, *res_pm;
|
||||
int err;
|
||||
struct lpc_ich_info *ich_info = pdev->dev.platform_data;
|
||||
struct lpc_ich_info *ich_info = dev_get_platdata(&pdev->dev);
|
||||
|
||||
if (!ich_info)
|
||||
return -ENODEV;
|
||||
|
||||
@@ -149,7 +149,7 @@ static int ttl_probe(struct platform_device *pdev)
|
||||
struct resource *res;
|
||||
int ret;
|
||||
|
||||
pdata = pdev->dev.platform_data;
|
||||
pdata = dev_get_platdata(&pdev->dev);
|
||||
if (!pdata) {
|
||||
dev_err(dev, "no platform data\n");
|
||||
ret = -ENXIO;
|
||||
|
||||
@@ -150,7 +150,7 @@ static int kempld_gpio_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct device *dev = &pdev->dev;
|
||||
struct kempld_device_data *pld = dev_get_drvdata(dev->parent);
|
||||
struct kempld_platform_data *pdata = pld->dev->platform_data;
|
||||
struct kempld_platform_data *pdata = dev_get_platdata(pld->dev);
|
||||
struct kempld_gpio_data *gpio;
|
||||
struct gpio_chip *chip;
|
||||
int ret;
|
||||
|
||||
@@ -166,7 +166,7 @@ int __max730x_probe(struct max7301 *ts)
|
||||
struct max7301_platform_data *pdata;
|
||||
int i, ret;
|
||||
|
||||
pdata = dev->platform_data;
|
||||
pdata = dev_get_platdata(dev);
|
||||
|
||||
mutex_init(&ts->lock);
|
||||
dev_set_drvdata(dev, ts);
|
||||
|
||||
@@ -453,7 +453,7 @@ static int max732x_irq_setup(struct max732x_chip *chip,
|
||||
const struct i2c_device_id *id)
|
||||
{
|
||||
struct i2c_client *client = chip->client;
|
||||
struct max732x_platform_data *pdata = client->dev.platform_data;
|
||||
struct max732x_platform_data *pdata = dev_get_platdata(&client->dev);
|
||||
int has_irq = max732x_features[id->driver_data] >> 32;
|
||||
int ret;
|
||||
|
||||
@@ -512,7 +512,7 @@ static int max732x_irq_setup(struct max732x_chip *chip,
|
||||
const struct i2c_device_id *id)
|
||||
{
|
||||
struct i2c_client *client = chip->client;
|
||||
struct max732x_platform_data *pdata = client->dev.platform_data;
|
||||
struct max732x_platform_data *pdata = dev_get_platdata(&client->dev);
|
||||
int has_irq = max732x_features[id->driver_data] >> 32;
|
||||
|
||||
if (pdata->irq_base && has_irq != INT_NONE)
|
||||
@@ -583,7 +583,7 @@ static int max732x_probe(struct i2c_client *client,
|
||||
uint16_t addr_a, addr_b;
|
||||
int ret, nr_port;
|
||||
|
||||
pdata = client->dev.platform_data;
|
||||
pdata = dev_get_platdata(&client->dev);
|
||||
if (pdata == NULL) {
|
||||
dev_dbg(&client->dev, "no platform data\n");
|
||||
return -EINVAL;
|
||||
@@ -653,7 +653,7 @@ out_failed:
|
||||
|
||||
static int max732x_remove(struct i2c_client *client)
|
||||
{
|
||||
struct max732x_platform_data *pdata = client->dev.platform_data;
|
||||
struct max732x_platform_data *pdata = dev_get_platdata(&client->dev);
|
||||
struct max732x_chip *chip = i2c_get_clientdata(client);
|
||||
int ret;
|
||||
|
||||
|
||||
@@ -86,7 +86,7 @@ static int mc33880_probe(struct spi_device *spi)
|
||||
struct mc33880_platform_data *pdata;
|
||||
int ret;
|
||||
|
||||
pdata = spi->dev.platform_data;
|
||||
pdata = dev_get_platdata(&spi->dev);
|
||||
if (!pdata || !pdata->base) {
|
||||
dev_dbg(&spi->dev, "incorrect or missing platform data\n");
|
||||
return -EINVAL;
|
||||
|
||||
@@ -520,7 +520,7 @@ static int mcp230xx_probe(struct i2c_client *client,
|
||||
|
||||
match = of_match_device(of_match_ptr(mcp23s08_i2c_of_match),
|
||||
&client->dev);
|
||||
pdata = client->dev.platform_data;
|
||||
pdata = dev_get_platdata(&client->dev);
|
||||
if (match || !pdata) {
|
||||
base = -1;
|
||||
pullups = 0;
|
||||
@@ -634,7 +634,7 @@ static int mcp23s08_probe(struct spi_device *spi)
|
||||
pullups[addr] = 0;
|
||||
} else {
|
||||
type = spi_get_device_id(spi)->driver_data;
|
||||
pdata = spi->dev.platform_data;
|
||||
pdata = dev_get_platdata(&spi->dev);
|
||||
if (!pdata || !gpio_is_valid(pdata->base)) {
|
||||
dev_dbg(&spi->dev,
|
||||
"invalid or missing platform data\n");
|
||||
|
||||
@@ -259,7 +259,7 @@ static void msic_gpio_irq_handler(unsigned irq, struct irq_desc *desc)
|
||||
static int platform_msic_gpio_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct device *dev = &pdev->dev;
|
||||
struct intel_msic_gpio_pdata *pdata = dev->platform_data;
|
||||
struct intel_msic_gpio_pdata *pdata = dev_get_platdata(dev);
|
||||
struct msic_gpio *mg;
|
||||
int irq = platform_get_irq(pdev, 0);
|
||||
int retval;
|
||||
|
||||
@@ -1100,7 +1100,7 @@ static int omap_gpio_probe(struct platform_device *pdev)
|
||||
|
||||
match = of_match_device(of_match_ptr(omap_gpio_match), dev);
|
||||
|
||||
pdata = match ? match->data : dev->platform_data;
|
||||
pdata = match ? match->data : dev_get_platdata(dev);
|
||||
if (!pdata)
|
||||
return -EINVAL;
|
||||
|
||||
|
||||
@@ -731,7 +731,7 @@ static int pca953x_probe(struct i2c_client *client,
|
||||
if (chip == NULL)
|
||||
return -ENOMEM;
|
||||
|
||||
pdata = client->dev.platform_data;
|
||||
pdata = dev_get_platdata(&client->dev);
|
||||
if (pdata) {
|
||||
irq_base = pdata->irq_base;
|
||||
chip->gpio_start = pdata->gpio_base;
|
||||
@@ -785,7 +785,7 @@ static int pca953x_probe(struct i2c_client *client,
|
||||
|
||||
static int pca953x_remove(struct i2c_client *client)
|
||||
{
|
||||
struct pca953x_platform_data *pdata = client->dev.platform_data;
|
||||
struct pca953x_platform_data *pdata = dev_get_platdata(&client->dev);
|
||||
struct pca953x_chip *chip = i2c_get_clientdata(client);
|
||||
int ret = 0;
|
||||
|
||||
|
||||
@@ -262,7 +262,7 @@ static int pcf857x_probe(struct i2c_client *client,
|
||||
struct pcf857x *gpio;
|
||||
int status;
|
||||
|
||||
pdata = client->dev.platform_data;
|
||||
pdata = dev_get_platdata(&client->dev);
|
||||
if (!pdata) {
|
||||
dev_dbg(&client->dev, "no platform data\n");
|
||||
}
|
||||
@@ -396,7 +396,7 @@ fail:
|
||||
|
||||
static int pcf857x_remove(struct i2c_client *client)
|
||||
{
|
||||
struct pcf857x_platform_data *pdata = client->dev.platform_data;
|
||||
struct pcf857x_platform_data *pdata = dev_get_platdata(&client->dev);
|
||||
struct pcf857x *gpio = i2c_get_clientdata(client);
|
||||
int status = 0;
|
||||
|
||||
|
||||
@@ -259,7 +259,7 @@ static const struct irq_domain_ops pl061_domain_ops = {
|
||||
static int pl061_probe(struct amba_device *adev, const struct amba_id *id)
|
||||
{
|
||||
struct device *dev = &adev->dev;
|
||||
struct pl061_platform_data *pdata = dev->platform_data;
|
||||
struct pl061_platform_data *pdata = dev_get_platdata(dev);
|
||||
struct pl061_gpio *chip;
|
||||
int ret, irq, i, irq_base;
|
||||
|
||||
|
||||
@@ -285,7 +285,7 @@ static struct irq_domain_ops gpio_rcar_irq_domain_ops = {
|
||||
|
||||
static void gpio_rcar_parse_pdata(struct gpio_rcar_priv *p)
|
||||
{
|
||||
struct gpio_rcar_config *pdata = p->pdev->dev.platform_data;
|
||||
struct gpio_rcar_config *pdata = dev_get_platdata(&p->pdev->dev);
|
||||
struct device_node *np = p->pdev->dev.of_node;
|
||||
struct of_phandle_args args;
|
||||
int ret;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user