Merge tag 'v6.8-rc4' into gpio/for-next
authorBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Mon, 12 Feb 2024 09:12:41 +0000 (10:12 +0100)
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Mon, 12 Feb 2024 09:12:41 +0000 (10:12 +0100)
Linux 6.8-rc4

Pulling this for a bugfix upstream with which the gpio/for-next branch
conflicts.

1  2 
MAINTAINERS
drivers/gpio/gpio-eic-sprd.c
drivers/gpio/gpiolib.c

diff --combined MAINTAINERS
index 2d0bc0e128bb8f88b59f945acfc706539e379f7f,73d898383e51f9c3a7ef6769cf9f6f6095f522e9..0f98b41895b0ccbcda23e6083f68b873b5f1dbb2
@@@ -3168,10 -3168,10 +3168,10 @@@ F:   drivers/hwmon/asus-ec-sensors.
  
  ASUS NOTEBOOKS AND EEEPC ACPI/WMI EXTRAS DRIVERS
  M:    Corentin Chary <corentin.chary@gmail.com>
- L:    acpi4asus-user@lists.sourceforge.net
+ M:    Luke D. Jones <luke@ljones.dev>
  L:    platform-driver-x86@vger.kernel.org
  S:    Maintained
- W:    http://acpi4asus.sf.net
+ W:    https://asus-linux.org/
  F:    drivers/platform/x86/asus*.c
  F:    drivers/platform/x86/eeepc*.c
  
@@@ -4169,14 -4169,14 +4169,14 @@@ F:   drivers/firmware/broadcom/tee_bnxt_f
  F:    drivers/net/ethernet/broadcom/bnxt/
  F:    include/linux/firmware/broadcom/tee_bnxt_fw.h
  
- BROADCOM BRCM80211 IEEE802.11n WIRELESS DRIVER
- M:    Arend van Spriel <aspriel@gmail.com>
- M:    Franky Lin <franky.lin@broadcom.com>
- M:    Hante Meuleman <hante.meuleman@broadcom.com>
+ BROADCOM BRCM80211 IEEE802.11 WIRELESS DRIVERS
+ M:    Arend van Spriel <arend.vanspriel@broadcom.com>
  L:    linux-wireless@vger.kernel.org
+ L:    brcm80211@lists.linux.dev
  L:    brcm80211-dev-list.pdl@broadcom.com
  S:    Supported
  F:    drivers/net/wireless/broadcom/brcm80211/
+ F:    include/linux/platform_data/brcmfmac.h
  
  BROADCOM BRCMSTB GPIO DRIVER
  M:    Doug Berger <opendmb@gmail.com>
@@@ -4547,7 -4547,7 +4547,7 @@@ F:      drivers/net/ieee802154/ca8210.
  
  CACHEFILES: FS-CACHE BACKEND FOR CACHING ON MOUNTED FILESYSTEMS
  M:    David Howells <dhowells@redhat.com>
- L:    linux-cachefs@redhat.com (moderated for non-subscribers)
+ L:    netfs@lists.linux.dev
  S:    Supported
  F:    Documentation/filesystems/caching/cachefiles.rst
  F:    fs/cachefiles/
@@@ -5958,7 -5958,6 +5958,6 @@@ S:      Maintaine
  F:    drivers/platform/x86/dell/dell-wmi-descriptor.c
  
  DELL WMI HARDWARE PRIVACY SUPPORT
- M:    Perry Yuan <Perry.Yuan@dell.com>
  L:    Dell.Client.Kernel@dell.com
  L:    platform-driver-x86@vger.kernel.org
  S:    Maintained
@@@ -7955,12 -7954,13 +7954,13 @@@ L:   rust-for-linux@vger.kernel.or
  S:    Maintained
  F:    rust/kernel/net/phy.rs
  
- EXEC & BINFMT API
+ EXEC & BINFMT API, ELF
  R:    Eric Biederman <ebiederm@xmission.com>
  R:    Kees Cook <keescook@chromium.org>
  L:    linux-mm@kvack.org
  S:    Supported
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git for-next/execve
+ F:    Documentation/userspace-api/ELF.rst
  F:    fs/*binfmt_*.c
  F:    fs/exec.c
  F:    include/linux/binfmts.h
@@@ -8223,7 -8223,8 +8223,8 @@@ F:      include/linux/iomap.
  
  FILESYSTEMS [NETFS LIBRARY]
  M:    David Howells <dhowells@redhat.com>
- L:    linux-cachefs@redhat.com (moderated for non-subscribers)
+ R:    Jeff Layton <jlayton@kernel.org>
+ L:    netfs@lists.linux.dev
  L:    linux-fsdevel@vger.kernel.org
  S:    Supported
  F:    Documentation/filesystems/caching/
@@@ -9148,7 -9149,6 +9149,7 @@@ S:      Maintaine
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux.git
  F:    Documentation/ABI/obsolete/sysfs-gpio
  F:    Documentation/ABI/testing/gpio-cdev
 +F:    Documentation/userspace-api/gpio/
  F:    drivers/gpio/gpiolib-cdev.c
  F:    include/uapi/linux/gpio.h
  F:    tools/gpio/
@@@ -10091,7 -10091,7 +10092,7 @@@ L:   linux-i2c@vger.kernel.or
  S:    Maintained
  W:    https://i2c.wiki.kernel.org/
  Q:    https://patchwork.ozlabs.org/project/linux-i2c/list/
- T:    git git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git
+ T:    git git://git.kernel.org/pub/scm/linux/kernel/git/andi.shyti/linux.git
  F:    Documentation/devicetree/bindings/i2c/
  F:    drivers/i2c/algos/
  F:    drivers/i2c/busses/
@@@ -10283,7 -10283,7 +10284,7 @@@ F:   drivers/scsi/ibmvscsi/ibmvscsi
  F:    include/scsi/viosrp.h
  
  IBM Power Virtual SCSI Device Target Driver
- M:    Michael Cyr <mikecyr@linux.ibm.com>
+ M:    Tyrel Datwyler <tyreld@linux.ibm.com>
  L:    linux-scsi@vger.kernel.org
  L:    target-devel@vger.kernel.org
  S:    Supported
@@@ -10801,11 -10801,11 +10802,11 @@@ F:        drivers/gpio/gpio-tangier.
  
  INTEL GVT-g DRIVERS (Intel GPU Virtualization)
  M:    Zhenyu Wang <zhenyuw@linux.intel.com>
- M:    Zhi Wang <zhi.a.wang@intel.com>
+ M:    Zhi Wang <zhi.wang.linux@gmail.com>
  L:    intel-gvt-dev@lists.freedesktop.org
  L:    intel-gfx@lists.freedesktop.org
  S:    Supported
- W:    https://01.org/igvt-g
+ W:    https://github.com/intel/gvt-linux/wiki
  T:    git https://github.com/intel/gvt-linux.git
  F:    drivers/gpu/drm/i915/gvt/
  
@@@ -11127,7 -11127,6 +11128,6 @@@ S:   Supporte
  F:    drivers/net/wireless/intel/iwlegacy/
  
  INTEL WIRELESS WIFI LINK (iwlwifi)
- M:    Gregory Greenman <gregory.greenman@intel.com>
  M:    Miri Korenblit <miriam.rachel.korenblit@intel.com>
  L:    linux-wireless@vger.kernel.org
  S:    Supported
@@@ -11725,6 -11724,7 +11725,7 @@@ F:   fs/smb/server
  KERNEL UNIT TESTING FRAMEWORK (KUnit)
  M:    Brendan Higgins <brendanhiggins@google.com>
  M:    David Gow <davidgow@google.com>
+ R:    Rae Moar <rmoar@google.com>
  L:    linux-kselftest@vger.kernel.org
  L:    kunit-dev@googlegroups.com
  S:    Maintained
@@@ -12903,6 -12903,8 +12904,8 @@@ M:   Alejandro Colomar <alx@kernel.org
  L:    linux-man@vger.kernel.org
  S:    Maintained
  W:    http://www.kernel.org/doc/man-pages
+ T:    git git://git.kernel.org/pub/scm/docs/man-pages/man-pages.git
+ T:    git git://www.alejandro-colomar.es/src/alx/linux/man-pages/man-pages.git
  
  MANAGEMENT COMPONENT TRANSPORT PROTOCOL (MCTP)
  M:    Jeremy Kerr <jk@codeconstruct.com.au>
@@@ -15178,6 -15180,7 +15181,7 @@@ F:   Documentation/networking/net_cacheli
  F:    drivers/connector/
  F:    drivers/net/
  F:    include/dt-bindings/net/
+ F:    include/linux/cn_proc.h
  F:    include/linux/etherdevice.h
  F:    include/linux/fcdevice.h
  F:    include/linux/fddidevice.h
@@@ -15185,6 -15188,7 +15189,7 @@@ F:   include/linux/hippidevice.
  F:    include/linux/if_*
  F:    include/linux/inetdevice.h
  F:    include/linux/netdevice.h
+ F:    include/uapi/linux/cn_proc.h
  F:    include/uapi/linux/if_*
  F:    include/uapi/linux/netdevice.h
  X:    drivers/net/wireless/
@@@ -16857,9 -16861,8 +16862,8 @@@ F:   Documentation/devicetree/bindings/pc
  F:    drivers/pci/controller/pcie-xilinx-cpm.c
  
  PCI ENDPOINT SUBSYSTEM
- M:    Lorenzo Pieralisi <lpieralisi@kernel.org>
+ M:    Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
  M:    Krzysztof WilczyƄski <kw@linux.com>
- R:    Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
  R:    Kishon Vijay Abraham I <kishon@kernel.org>
  L:    linux-pci@vger.kernel.org
  S:    Supported
@@@ -17179,7 -17182,7 +17183,7 @@@ R:   John Garry <john.g.garry@oracle.com
  R:    Will Deacon <will@kernel.org>
  R:    James Clark <james.clark@arm.com>
  R:    Mike Leach <mike.leach@linaro.org>
- R:    Leo Yan <leo.yan@linaro.org>
+ R:    Leo Yan <leo.yan@linux.dev>
  L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
  S:    Supported
  F:    tools/build/feature/test-libopencsd.c
@@@ -18082,7 -18085,6 +18086,6 @@@ F:   drivers/net/ethernet/qualcomm/emac
  
  QUALCOMM ETHQOS ETHERNET DRIVER
  M:    Vinod Koul <vkoul@kernel.org>
- R:    Bhupesh Sharma <bhupesh.sharma@linaro.org>
  L:    netdev@vger.kernel.org
  L:    linux-arm-msm@vger.kernel.org
  S:    Maintained
@@@ -18429,7 -18431,7 +18432,7 @@@ S:   Supporte
  F:    drivers/infiniband/sw/rdmavt
  
  RDS - RELIABLE DATAGRAM SOCKETS
- M:    Santosh Shilimkar <santosh.shilimkar@oracle.com>
+ M:    Allison Henderson <allison.henderson@oracle.com>
  L:    netdev@vger.kernel.org
  L:    linux-rdma@vger.kernel.org
  L:    rds-devel@oss.oracle.com (moderated for non-subscribers)
@@@ -20550,6 -20552,7 +20553,7 @@@ F:   Documentation/translations/sp_SP
  
  SPARC + UltraSPARC (sparc/sparc64)
  M:    "David S. Miller" <davem@davemloft.net>
+ M:    Andreas Larsson <andreas@gaisler.com>
  L:    sparclinux@vger.kernel.org
  S:    Maintained
  Q:    http://patchwork.ozlabs.org/project/sparclinux/list/
@@@ -24340,13 -24343,6 +24344,6 @@@ T:  git git://git.kernel.org/pub/scm/lin
  F:    Documentation/filesystems/zonefs.rst
  F:    fs/zonefs/
  
- ZPOOL COMPRESSED PAGE STORAGE API
- M:    Dan Streetman <ddstreet@ieee.org>
- L:    linux-mm@kvack.org
- S:    Maintained
- F:    include/linux/zpool.h
- F:    mm/zpool.c
  ZR36067 VIDEO FOR LINUX DRIVER
  M:    Corentin Labbe <clabbe@baylibre.com>
  L:    mjpeg-users@lists.sourceforge.net
@@@ -24398,7 -24394,9 +24395,9 @@@ M:   Nhat Pham <nphamcs@gmail.com
  L:    linux-mm@kvack.org
  S:    Maintained
  F:    Documentation/admin-guide/mm/zswap.rst
+ F:    include/linux/zpool.h
  F:    include/linux/zswap.h
+ F:    mm/zpool.c
  F:    mm/zswap.c
  
  THE REST
index 6aed3e2732f7df5561be24313ef39b738d7a3d8d,806b88d8dfb7bda7d23cae021eb08c3bbf383ab1..2dd0e46c42adde2dd05b54ae41bb5d8341cd6beb
@@@ -108,6 -108,7 +108,6 @@@ static struct sprd_eic *to_sprd_eic(str
  
  struct sprd_eic_variant_data {
        enum sprd_eic_type type;
 -      u32 num_eics;
  };
  
  static const char *sprd_eic_label_name[SPRD_EIC_MAX] = {
  
  static const struct sprd_eic_variant_data sc9860_eic_dbnc_data = {
        .type = SPRD_EIC_DEBOUNCE,
 -      .num_eics = 8,
  };
  
  static const struct sprd_eic_variant_data sc9860_eic_latch_data = {
        .type = SPRD_EIC_LATCH,
 -      .num_eics = 8,
  };
  
  static const struct sprd_eic_variant_data sc9860_eic_async_data = {
        .type = SPRD_EIC_ASYNC,
 -      .num_eics = 8,
  };
  
  static const struct sprd_eic_variant_data sc9860_eic_sync_data = {
        .type = SPRD_EIC_SYNC,
 -      .num_eics = 8,
  };
  
  static inline void __iomem *sprd_eic_offset_base(struct sprd_eic *sprd_eic,
@@@ -325,20 -330,27 +325,27 @@@ static int sprd_eic_irq_set_type(struc
                switch (flow_type) {
                case IRQ_TYPE_LEVEL_HIGH:
                        sprd_eic_update(chip, offset, SPRD_EIC_DBNC_IEV, 1);
+                       sprd_eic_update(chip, offset, SPRD_EIC_DBNC_IC, 1);
                        break;
                case IRQ_TYPE_LEVEL_LOW:
                        sprd_eic_update(chip, offset, SPRD_EIC_DBNC_IEV, 0);
+                       sprd_eic_update(chip, offset, SPRD_EIC_DBNC_IC, 1);
                        break;
                case IRQ_TYPE_EDGE_RISING:
                case IRQ_TYPE_EDGE_FALLING:
                case IRQ_TYPE_EDGE_BOTH:
                        state = sprd_eic_get(chip, offset);
-                       if (state)
+                       if (state) {
                                sprd_eic_update(chip, offset,
                                                SPRD_EIC_DBNC_IEV, 0);
-                       else
+                               sprd_eic_update(chip, offset,
+                                               SPRD_EIC_DBNC_IC, 1);
+                       } else {
                                sprd_eic_update(chip, offset,
                                                SPRD_EIC_DBNC_IEV, 1);
+                               sprd_eic_update(chip, offset,
+                                               SPRD_EIC_DBNC_IC, 1);
+                       }
                        break;
                default:
                        return -ENOTSUPP;
                switch (flow_type) {
                case IRQ_TYPE_LEVEL_HIGH:
                        sprd_eic_update(chip, offset, SPRD_EIC_LATCH_INTPOL, 0);
+                       sprd_eic_update(chip, offset, SPRD_EIC_LATCH_INTCLR, 1);
                        break;
                case IRQ_TYPE_LEVEL_LOW:
                        sprd_eic_update(chip, offset, SPRD_EIC_LATCH_INTPOL, 1);
+                       sprd_eic_update(chip, offset, SPRD_EIC_LATCH_INTCLR, 1);
                        break;
                case IRQ_TYPE_EDGE_RISING:
                case IRQ_TYPE_EDGE_FALLING:
                case IRQ_TYPE_EDGE_BOTH:
                        state = sprd_eic_get(chip, offset);
-                       if (state)
+                       if (state) {
                                sprd_eic_update(chip, offset,
                                                SPRD_EIC_LATCH_INTPOL, 0);
-                       else
+                               sprd_eic_update(chip, offset,
+                                               SPRD_EIC_LATCH_INTCLR, 1);
+                       } else {
                                sprd_eic_update(chip, offset,
                                                SPRD_EIC_LATCH_INTPOL, 1);
+                               sprd_eic_update(chip, offset,
+                                               SPRD_EIC_LATCH_INTCLR, 1);
+                       }
                        break;
                default:
                        return -ENOTSUPP;
                        sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTBOTH, 0);
                        sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTMODE, 0);
                        sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTPOL, 1);
+                       sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTCLR, 1);
                        irq_set_handler_locked(data, handle_edge_irq);
                        break;
                case IRQ_TYPE_EDGE_FALLING:
                        sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTBOTH, 0);
                        sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTMODE, 0);
                        sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTPOL, 0);
+                       sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTCLR, 1);
                        irq_set_handler_locked(data, handle_edge_irq);
                        break;
                case IRQ_TYPE_EDGE_BOTH:
                        sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTMODE, 0);
                        sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTBOTH, 1);
+                       sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTCLR, 1);
                        irq_set_handler_locked(data, handle_edge_irq);
                        break;
                case IRQ_TYPE_LEVEL_HIGH:
                        sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTBOTH, 0);
                        sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTMODE, 1);
                        sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTPOL, 1);
+                       sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTCLR, 1);
                        irq_set_handler_locked(data, handle_level_irq);
                        break;
                case IRQ_TYPE_LEVEL_LOW:
                        sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTBOTH, 0);
                        sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTMODE, 1);
                        sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTPOL, 0);
+                       sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTCLR, 1);
                        irq_set_handler_locked(data, handle_level_irq);
                        break;
                default:
                        sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTBOTH, 0);
                        sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTMODE, 0);
                        sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTPOL, 1);
+                       sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTCLR, 1);
                        irq_set_handler_locked(data, handle_edge_irq);
                        break;
                case IRQ_TYPE_EDGE_FALLING:
                        sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTBOTH, 0);
                        sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTMODE, 0);
                        sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTPOL, 0);
+                       sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTCLR, 1);
                        irq_set_handler_locked(data, handle_edge_irq);
                        break;
                case IRQ_TYPE_EDGE_BOTH:
                        sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTMODE, 0);
                        sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTBOTH, 1);
+                       sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTCLR, 1);
                        irq_set_handler_locked(data, handle_edge_irq);
                        break;
                case IRQ_TYPE_LEVEL_HIGH:
                        sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTBOTH, 0);
                        sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTMODE, 1);
                        sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTPOL, 1);
+                       sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTCLR, 1);
                        irq_set_handler_locked(data, handle_level_irq);
                        break;
                case IRQ_TYPE_LEVEL_LOW:
                        sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTBOTH, 0);
                        sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTMODE, 1);
                        sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTPOL, 0);
+                       sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTCLR, 1);
                        irq_set_handler_locked(data, handle_level_irq);
                        break;
                default:
@@@ -590,7 -619,6 +614,7 @@@ static int sprd_eic_probe(struct platfo
        struct gpio_irq_chip *irq;
        struct sprd_eic *sprd_eic;
        struct resource *res;
 +      u16 num_banks = 0;
        int ret, i;
  
        pdata = of_device_get_match_data(dev);
                sprd_eic->base[i] = devm_ioremap_resource(dev, res);
                if (IS_ERR(sprd_eic->base[i]))
                        return PTR_ERR(sprd_eic->base[i]);
 +
 +              num_banks++;
        }
  
        sprd_eic->chip.label = sprd_eic_label_name[sprd_eic->type];
 -      sprd_eic->chip.ngpio = pdata->num_eics;
 +      sprd_eic->chip.ngpio = num_banks * SPRD_EIC_PER_BANK_NR;
        sprd_eic->chip.base = -1;
        sprd_eic->chip.parent = dev;
        sprd_eic->chip.direction_input = sprd_eic_direction_input;
diff --combined drivers/gpio/gpiolib.c
index 3cad49363a72f390e786d98e0bb2813a2e6d3e76,8b3a0f45b57456b13a04ecf4bf706b8cbf27b8dd..d068788adb106b5690b8d4e612ccea8a647f9161
@@@ -63,7 -63,7 +63,7 @@@ static int gpio_bus_match(struct devic
        return 1;
  }
  
 -static struct bus_type gpio_bus_type = {
 +static const struct bus_type gpio_bus_type = {
        .name = "gpio",
        .match = gpio_bus_match,
  };
@@@ -663,11 -663,6 +663,11 @@@ static void gpiodev_release(struct devi
        kfree(gdev);
  }
  
 +static const struct device_type gpio_dev_type = {
 +      .name = "gpio_chip",
 +      .release = gpiodev_release,
 +};
 +
  #ifdef CONFIG_GPIO_CDEV
  #define gcdev_register(gdev, devt)    gpiolib_cdev_register((gdev), (devt))
  #define gcdev_unregister(gdev)                gpiolib_cdev_unregister((gdev))
@@@ -685,8 -680,6 +685,8 @@@ static int gpiochip_setup_dev(struct gp
        struct fwnode_handle *fwnode = dev_fwnode(&gdev->dev);
        int ret;
  
 +      device_initialize(&gdev->dev);
 +
        /*
         * If fwnode doesn't belong to another device, it's safe to clear its
         * initialized flag.
        if (ret)
                return ret;
  
 -      /* From this point, the .release() function cleans up gpio_device */
 -      gdev->dev.release = gpiodev_release;
 -
        ret = gpiochip_sysfs_register(gdev);
        if (ret)
                goto err_remove_device;
@@@ -829,8 -825,6 +829,8 @@@ int gpiochip_add_data_with_key(struct g
        gdev = kzalloc(sizeof(*gdev), GFP_KERNEL);
        if (!gdev)
                return -ENOMEM;
 +
 +      gdev->dev.type = &gpio_dev_type;
        gdev->dev.bus = &gpio_bus_type;
        gdev->dev.parent = gc->parent;
        gdev->chip = gc;
        if (ret)
                goto err_free_ida;
  
 -      device_initialize(&gdev->dev);
        if (gc->parent && gc->parent->driver)
                gdev->owner = gc->parent->driver->owner;
        else if (gc->owner)
@@@ -1010,15 -1005,15 +1010,15 @@@ err_remove_of_chip
  err_free_gpiochip_mask:
        gpiochip_remove_pin_ranges(gc);
        gpiochip_free_valid_mask(gc);
+ err_remove_from_list:
+       spin_lock_irqsave(&gpio_lock, flags);
+       list_del(&gdev->list);
+       spin_unlock_irqrestore(&gpio_lock, flags);
        if (gdev->dev.release) {
                /* release() has been registered by gpiochip_setup_dev() */
                gpio_device_put(gdev);
                goto err_print_message;
        }
- err_remove_from_list:
-       spin_lock_irqsave(&gpio_lock, flags);
-       list_del(&gdev->list);
-       spin_unlock_irqrestore(&gpio_lock, flags);
  err_free_label:
        kfree_const(gdev->label);
  err_free_descs:
@@@ -1259,8 -1254,8 +1259,8 @@@ static void gpiochip_irqchip_free_valid
        gpiochip_free_mask(&gc->irq.valid_mask);
  }
  
 -bool gpiochip_irqchip_irq_valid(const struct gpio_chip *gc,
 -                              unsigned int offset)
 +static bool gpiochip_irqchip_irq_valid(const struct gpio_chip *gc,
 +                                     unsigned int offset)
  {
        if (!gpiochip_line_is_valid(gc, offset))
                return false;
                return true;
        return test_bit(offset, gc->irq.valid_mask);
  }
 -EXPORT_SYMBOL_GPL(gpiochip_irqchip_irq_valid);
  
  #ifdef CONFIG_IRQ_DOMAIN_HIERARCHY
  
@@@ -1443,43 -1439,6 +1443,43 @@@ static unsigned int gpiochip_child_offs
        return offset;
  }
  
 +/**
 + * gpiochip_irq_domain_activate() - Lock a GPIO to be used as an IRQ
 + * @domain: The IRQ domain used by this IRQ chip
 + * @data: Outermost irq_data associated with the IRQ
 + * @reserve: If set, only reserve an interrupt vector instead of assigning one
 + *
 + * This function is a wrapper that calls gpiochip_lock_as_irq() and is to be
 + * used as the activate function for the &struct irq_domain_ops. The host_data
 + * for the IRQ domain must be the &struct gpio_chip.
 + */
 +static int gpiochip_irq_domain_activate(struct irq_domain *domain,
 +                                      struct irq_data *data, bool reserve)
 +{
 +      struct gpio_chip *gc = domain->host_data;
 +      unsigned int hwirq = irqd_to_hwirq(data);
 +
 +      return gpiochip_lock_as_irq(gc, hwirq);
 +}
 +
 +/**
 + * gpiochip_irq_domain_deactivate() - Unlock a GPIO used as an IRQ
 + * @domain: The IRQ domain used by this IRQ chip
 + * @data: Outermost irq_data associated with the IRQ
 + *
 + * This function is a wrapper that will call gpiochip_unlock_as_irq() and is to
 + * be used as the deactivate function for the &struct irq_domain_ops. The
 + * host_data for the IRQ domain must be the &struct gpio_chip.
 + */
 +static void gpiochip_irq_domain_deactivate(struct irq_domain *domain,
 +                                         struct irq_data *data)
 +{
 +      struct gpio_chip *gc = domain->host_data;
 +      unsigned int hwirq = irqd_to_hwirq(data);
 +
 +      return gpiochip_unlock_as_irq(gc, hwirq);
 +}
 +
  static void gpiochip_hierarchy_setup_domain_ops(struct irq_domain_ops *ops)
  {
        ops->activate = gpiochip_irq_domain_activate;
@@@ -1597,8 -1556,7 +1597,8 @@@ static bool gpiochip_hierarchy_is_hiera
   * gpiochip by assigning the gpiochip as chip data, and using the irqchip
   * stored inside the gpiochip.
   */
 -int gpiochip_irq_map(struct irq_domain *d, unsigned int irq, irq_hw_number_t hwirq)
 +static int gpiochip_irq_map(struct irq_domain *d, unsigned int irq,
 +                          irq_hw_number_t hwirq)
  {
        struct gpio_chip *gc = d->host_data;
        int ret = 0;
  
        return 0;
  }
 -EXPORT_SYMBOL_GPL(gpiochip_irq_map);
  
 -void gpiochip_irq_unmap(struct irq_domain *d, unsigned int irq)
 +static void gpiochip_irq_unmap(struct irq_domain *d, unsigned int irq)
  {
        struct gpio_chip *gc = d->host_data;
  
        irq_set_chip_and_handler(irq, NULL, NULL);
        irq_set_chip_data(irq, NULL);
  }
 -EXPORT_SYMBOL_GPL(gpiochip_irq_unmap);
  
  static const struct irq_domain_ops gpiochip_domain_ops = {
        .map    = gpiochip_irq_map,
@@@ -1666,6 -1626,50 +1666,6 @@@ static struct irq_domain *gpiochip_simp
        return domain;
  }
  
 -/*
 - * TODO: move these activate/deactivate in under the hierarchicial
 - * irqchip implementation as static once SPMI and SSBI (all external
 - * users) are phased over.
 - */
 -/**
 - * gpiochip_irq_domain_activate() - Lock a GPIO to be used as an IRQ
 - * @domain: The IRQ domain used by this IRQ chip
 - * @data: Outermost irq_data associated with the IRQ
 - * @reserve: If set, only reserve an interrupt vector instead of assigning one
 - *
 - * This function is a wrapper that calls gpiochip_lock_as_irq() and is to be
 - * used as the activate function for the &struct irq_domain_ops. The host_data
 - * for the IRQ domain must be the &struct gpio_chip.
 - */
 -int gpiochip_irq_domain_activate(struct irq_domain *domain,
 -                               struct irq_data *data, bool reserve)
 -{
 -      struct gpio_chip *gc = domain->host_data;
 -      unsigned int hwirq = irqd_to_hwirq(data);
 -
 -      return gpiochip_lock_as_irq(gc, hwirq);
 -}
 -EXPORT_SYMBOL_GPL(gpiochip_irq_domain_activate);
 -
 -/**
 - * gpiochip_irq_domain_deactivate() - Unlock a GPIO used as an IRQ
 - * @domain: The IRQ domain used by this IRQ chip
 - * @data: Outermost irq_data associated with the IRQ
 - *
 - * This function is a wrapper that will call gpiochip_unlock_as_irq() and is to
 - * be used as the deactivate function for the &struct irq_domain_ops. The
 - * host_data for the IRQ domain must be the &struct gpio_chip.
 - */
 -void gpiochip_irq_domain_deactivate(struct irq_domain *domain,
 -                                  struct irq_data *data)
 -{
 -      struct gpio_chip *gc = domain->host_data;
 -      unsigned int hwirq = irqd_to_hwirq(data);
 -
 -      return gpiochip_unlock_as_irq(gc, hwirq);
 -}
 -EXPORT_SYMBOL_GPL(gpiochip_irq_domain_deactivate);
 -
  static int gpiochip_to_irq(struct gpio_chip *gc, unsigned int offset)
  {
        struct irq_domain *domain = gc->irq.domain;