Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp3171522ybh; Sat, 25 Jul 2020 13:33:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwkDF1RP2527gfwr0o2PplKp2kqCf4fJRKGfRmWy2D05obgPrredXy7f8DehwPPGcvB+E0I X-Received: by 2002:a17:906:248a:: with SMTP id e10mr14589821ejb.454.1595709189578; Sat, 25 Jul 2020 13:33:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595709189; cv=none; d=google.com; s=arc-20160816; b=mlyOZaG8SCzRdj0ATuHvuq9xXFuy7YuLVy4Ei4hBJNmJpVRiFbyR5YlOKW2wAMbep0 K9eTXt/dmVYgW3Kb8zYUVYOSErMASMaLKPkjBlQfpoBF93k6BGQyt0uFCoX3pCBsTBcb R/WsMLwmmG+E9UJlVVe3nH008An6EpUFvBYi6aCM8AB5tMQF4rljM6YMUkhtwbMEH8Nf 8bBhh0637uBCgmoeXeUGM3lcnk769VOU+bBs3aziUDHYM2IDG+EeDQa8+xV4fL2BWp8J +INbz67E5bEyiOO7TDSvE+TOn+DIsN9Gje/ZGnMkLwkenIVZYAkNX4D0/7EykI7witl7 +lPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=nwY+/tJ0rnnwCDiaWmm+N+wbOgL2p5NbRLZLkADAyRw=; b=ITgTYFW+y/qC2bhtx6QLXYDE8JG0IqxwLFdAtDXG8GdUIT1blP+nzObzsd2vg5H8NH rv+d1M/Hm1LcB+OsP8Bl4hcgBpsS2qUKEod5WKtmcmOckCpXnC+o5I+rvz6EcEyjVDJx WzpUVafCXchA3AW5hMc8D7sRJgFSNBEnYKm05UiAnuOgTsubsi/kDnKlKLbmFDHoS4eI A7OUU+MMboaMclnwIBOGGErxRhxwSMuYZjYCZKf5dnheY66RYK2qae5N3SsO3gNnsKcV bx4lje+RFCau1RRwYgXosXc47/cQc2AutLAwqgLeHeWYAN1NkT+wbeCZxqU8gitbix++ aC2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=YpmyHvZt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p13si2632685ejd.637.2020.07.25.13.32.46; Sat, 25 Jul 2020 13:33:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=YpmyHvZt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727954AbgGYUaH (ORCPT + 99 others); Sat, 25 Jul 2020 16:30:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43580 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726834AbgGYUaH (ORCPT ); Sat, 25 Jul 2020 16:30:07 -0400 Received: from mail-pj1-x1041.google.com (mail-pj1-x1041.google.com [IPv6:2607:f8b0:4864:20::1041]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5540CC08C5C0; Sat, 25 Jul 2020 13:30:07 -0700 (PDT) Received: by mail-pj1-x1041.google.com with SMTP id a9so7076053pjd.3; Sat, 25 Jul 2020 13:30:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=nwY+/tJ0rnnwCDiaWmm+N+wbOgL2p5NbRLZLkADAyRw=; b=YpmyHvZtSrZ6atS0RCrqRZ1Z0vHqKFnlljCO8iS8qa0Tmiznt12PZprJuqovWCPno7 qamlb0T3rj+7Zm63S68BPi23q7OEN+gTqVr0fSeEjB8RJw4/NQgX8jvDnboWSa5zN/Lk fDbaeU+CVw1V7SJtghaqbBM8RTTN2fgk/cYpy16TjS4YdAgnt39mdb+iW7oIoKqBXU3/ pLXrQRKLrAjp8QPFcu2S+pjy7uqB3Iz5C9LmBgXF4ShJiDRluqXHfoqujDVSbZ+O7WPF dUGQyTCRut4ARqVmw0/6WRDP9EvWY7TKO6d4NuV7vRXSO/MMG6aGyPDj0bFq0U3vFgda W59A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=nwY+/tJ0rnnwCDiaWmm+N+wbOgL2p5NbRLZLkADAyRw=; b=F4H7ZmGQhRihb6jkokbSgK3cqVlX/zb0TEyKhw5wEx4jTwly3q/j6Qn/k5ysWg4eZr mFSfFywCVtySBQBss/IMXIMBA99FUZPp4PcG6fbI7Hx2hRAIBdcNOor6heYcjrgxl1RG cdKH8TLJWxtipfWWuVBOJ5Lt7gZ2UPe1XIgErAwa2jdc/SNtMLx4EiHcL6hBi9iZkQBj SegpPBsm9iZh2pUdbcR3LWlCdW5rhw0hW5LziN86N6EsxyktZfaIi60jtqZIyi7oWjmr UJ14C0P6qYyYzNg3b5ErfTCq5T+JaO1sOJP63nSpHxc5ZWtcYkEuQo3QUVlOgsR8q6O6 FO4g== X-Gm-Message-State: AOAM533DPqLZKhghKHVLUo26iswqbeF8QGIArc/vwv4ofksgISMycnsi o02zmM5QrBOY8bLX5Qdq7EimEndPNBm5l0sPwTk= X-Received: by 2002:a17:902:9a4b:: with SMTP id x11mr13333727plv.255.1595709006739; Sat, 25 Jul 2020 13:30:06 -0700 (PDT) MIME-Version: 1.0 References: <20200725041955.9985-1-warthog618@gmail.com> <20200725041955.9985-4-warthog618@gmail.com> In-Reply-To: <20200725041955.9985-4-warthog618@gmail.com> From: Andy Shevchenko Date: Sat, 25 Jul 2020 23:29:50 +0300 Message-ID: Subject: Re: [PATCH v2 03/18] gpiolib: make cdev a build option To: Kent Gibson Cc: Linux Kernel Mailing List , "open list:GPIO SUBSYSTEM" , Bartosz Golaszewski , Linus Walleij Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Jul 25, 2020 at 7:21 AM Kent Gibson wrote: > > Make the gpiolib-cdev module a build option. This allows the CDEV > interface to be removed from the kernel to reduce kernel size in > applications where is it not required, and provides the parent for > other other CDEV interface specific build options to follow. > > Suggested-by: Bartosz Golaszewski > Signed-off-by: Kent Gibson > --- > drivers/gpio/Kconfig | 16 ++++++++++++++-- > drivers/gpio/Makefile | 2 +- > drivers/gpio/gpiolib-cdev.h | 15 +++++++++++++++ > 3 files changed, 30 insertions(+), 3 deletions(-) > > diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig > index 8030fd91a3cc..b5bb9efc1092 100644 > --- a/drivers/gpio/Kconfig > +++ b/drivers/gpio/Kconfig > @@ -66,8 +66,20 @@ config GPIO_SYSFS > > This ABI is deprecated. If you want to use GPIO from userspace, > use the character device /dev/gpiochipN with the appropriate > - ioctl() operations instead. The character device is always > - available. > + ioctl() operations instead. > + > +config GPIO_CDEV > + bool "/dev/gpiochipN (character device interface)" > + default y > + help > + Say Y here to add the character device /dev/gpiochipN interface > + for GPIOs. The character device allows userspace to control GPIOs > + using ioctl() operations. > + > + Only say N is you are sure that the GPIO character device is not is -> if > + required. > + > + If unsure, say Y. > > config GPIO_GENERIC > depends on HAS_IOMEM # Only for IOMEM drivers > diff --git a/drivers/gpio/Makefile b/drivers/gpio/Makefile > index 4f9abff4f2dc..7c24c8d77068 100644 > --- a/drivers/gpio/Makefile > +++ b/drivers/gpio/Makefile > @@ -7,8 +7,8 @@ obj-$(CONFIG_GPIOLIB) += gpiolib.o > obj-$(CONFIG_GPIOLIB) += gpiolib-devres.o > obj-$(CONFIG_GPIOLIB) += gpiolib-legacy.o > obj-$(CONFIG_GPIOLIB) += gpiolib-devprop.o > -obj-$(CONFIG_GPIOLIB) += gpiolib-cdev.o > obj-$(CONFIG_OF_GPIO) += gpiolib-of.o > +obj-$(CONFIG_GPIO_CDEV) += gpiolib-cdev.o > obj-$(CONFIG_GPIO_SYSFS) += gpiolib-sysfs.o > obj-$(CONFIG_GPIO_ACPI) += gpiolib-acpi.o > > diff --git a/drivers/gpio/gpiolib-cdev.h b/drivers/gpio/gpiolib-cdev.h > index 973578e7ad10..19a4e3d57120 100644 > --- a/drivers/gpio/gpiolib-cdev.h > +++ b/drivers/gpio/gpiolib-cdev.h > @@ -5,7 +5,22 @@ > > #include > > +#ifdef CONFIG_GPIO_CDEV > + > int gpiolib_cdev_register(struct gpio_device *gdev, dev_t devt); > void gpiolib_cdev_unregister(struct gpio_device *gdev); > > +#else > + > +static inline int gpiolib_cdev_register(struct gpio_device *gdev, dev_t devt) > +{ > + return 0; > +} > + > +static inline void gpiolib_cdev_unregister(struct gpio_device *gdev) > +{ > +} > + > +#endif /* CONFIG_GPIO_CDEV */ > + > #endif /* GPIOLIB_CDEV_H */ > -- > 2.27.0 > -- With Best Regards, Andy Shevchenko