hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/gpio/gpio-sta2x11.c
....@@ -1,23 +1,10 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * STMicroelectronics ConneXt (STA2X11) GPIO driver
34 *
45 * Copyright 2012 ST Microelectronics (Alessandro Rubini)
56 * Based on gpio-ml-ioh.c, Copyright 2010 OKI Semiconductors Ltd.
67 * Also based on previous sta2x11 work, Copyright 2011 Wind River Systems, Inc.
7
- *
8
- * This program is free software; you can redistribute it and/or modify
9
- * it under the terms of the GNU General Public License version 2 as
10
- * published by the Free Software Foundation.
11
- *
12
- * This program is distributed in the hope that it will be useful,
13
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15
- * See the GNU General Public License for more details.
16
- *
17
- * You should have received a copy of the GNU General Public License
18
- * along with this program; if not, write to the Free Software
19
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20
- *
218 */
229
2310 #include <linux/init.h>
....@@ -360,7 +347,6 @@
360347 struct pci_dev *pdev;
361348 struct sta2x11_gpio_pdata *gpio_pdata;
362349 struct gsta_gpio *chip;
363
- struct resource *res;
364350
365351 pdev = *(struct pci_dev **)dev_get_platdata(&dev->dev);
366352 gpio_pdata = dev_get_platdata(&pdev->dev);
....@@ -369,13 +355,11 @@
369355 dev_err(&dev->dev, "no gpio config\n");
370356 pr_debug("gpio config: %p\n", gpio_pdata);
371357
372
- res = platform_get_resource(dev, IORESOURCE_MEM, 0);
373
-
374358 chip = devm_kzalloc(&dev->dev, sizeof(*chip), GFP_KERNEL);
375359 if (!chip)
376360 return -ENOMEM;
377361 chip->dev = &dev->dev;
378
- chip->reg_base = devm_ioremap_resource(&dev->dev, res);
362
+ chip->reg_base = devm_platform_ioremap_resource(dev, 0);
379363 if (IS_ERR(chip->reg_base))
380364 return PTR_ERR(chip->reg_base);
381365