Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752082AbbFYRbJ (ORCPT ); Thu, 25 Jun 2015 13:31:09 -0400 Received: from comal.ext.ti.com ([198.47.26.152]:56613 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751978AbbFYRa7 (ORCPT ); Thu, 25 Jun 2015 13:30:59 -0400 From: Grygorii Strashko To: Linus Walleij , Alexandre Courbot CC: Sekhar Nori , , , Grygorii Strashko , Johan Hovold Subject: [PATCH 2/2] gpiolib: assign chip owner to dev->driver->owner if not set Date: Thu, 25 Jun 2015 20:30:51 +0300 Message-ID: <1435253451-19817-2-git-send-email-grygorii.strashko@ti.com> X-Mailer: git-send-email 2.4.4 In-Reply-To: <1435253451-19817-1-git-send-email-grygorii.strashko@ti.com> References: <1435253451-19817-1-git-send-email-grygorii.strashko@ti.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1095 Lines: 38 Assign GPIO chip owner field to chip->dev->driver->owner if it was not configured by GPIO driver. Cc: Johan Hovold Signed-off-by: Grygorii Strashko --- Hi, There is also one positive additional side effect: lines like below can be removed from a lot of GPIO drivers rdc321x_gpio_dev->chip.owner = THIS_MODULE; drivers/gpio/gpiolib.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index 9b1d247..d51af5d 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c @@ -287,6 +287,9 @@ int gpiochip_add(struct gpio_chip *chip) INIT_LIST_HEAD(&chip->pin_ranges); #endif + if (!chip->owner && chip->dev && chip->dev->driver) + chip->owner = chip->dev->driver->owner; + of_gpiochip_add(chip); acpi_gpiochip_add(chip); -- 2.4.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/