| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * STMicroelectronics ConneXt (STA2X11) GPIO driver |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Copyright 2012 ST Microelectronics (Alessandro Rubini) |
|---|
| 5 | 6 | * Based on gpio-ml-ioh.c, Copyright 2010 OKI Semiconductors Ltd. |
|---|
| 6 | 7 | * 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 | | - * |
|---|
| 21 | 8 | */ |
|---|
| 22 | 9 | |
|---|
| 23 | 10 | #include <linux/init.h> |
|---|
| .. | .. |
|---|
| 360 | 347 | struct pci_dev *pdev; |
|---|
| 361 | 348 | struct sta2x11_gpio_pdata *gpio_pdata; |
|---|
| 362 | 349 | struct gsta_gpio *chip; |
|---|
| 363 | | - struct resource *res; |
|---|
| 364 | 350 | |
|---|
| 365 | 351 | pdev = *(struct pci_dev **)dev_get_platdata(&dev->dev); |
|---|
| 366 | 352 | gpio_pdata = dev_get_platdata(&pdev->dev); |
|---|
| .. | .. |
|---|
| 369 | 355 | dev_err(&dev->dev, "no gpio config\n"); |
|---|
| 370 | 356 | pr_debug("gpio config: %p\n", gpio_pdata); |
|---|
| 371 | 357 | |
|---|
| 372 | | - res = platform_get_resource(dev, IORESOURCE_MEM, 0); |
|---|
| 373 | | - |
|---|
| 374 | 358 | chip = devm_kzalloc(&dev->dev, sizeof(*chip), GFP_KERNEL); |
|---|
| 375 | 359 | if (!chip) |
|---|
| 376 | 360 | return -ENOMEM; |
|---|
| 377 | 361 | chip->dev = &dev->dev; |
|---|
| 378 | | - chip->reg_base = devm_ioremap_resource(&dev->dev, res); |
|---|
| 362 | + chip->reg_base = devm_platform_ioremap_resource(dev, 0); |
|---|
| 379 | 363 | if (IS_ERR(chip->reg_base)) |
|---|
| 380 | 364 | return PTR_ERR(chip->reg_base); |
|---|
| 381 | 365 | |
|---|