From patchwork Wed Dec 9 13:46:18 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 58115 Delivered-To: patch@linaro.org Received: by 10.112.147.194 with SMTP id tm2csp678646lbb; Wed, 9 Dec 2015 05:46:25 -0800 (PST) X-Received: by 10.98.73.133 with SMTP id r5mr12885910pfi.160.1449668785273; Wed, 09 Dec 2015 05:46:25 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 18si12844963pfm.219.2015.12.09.05.46.25 for ; Wed, 09 Dec 2015 05:46:25 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-leds-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-leds-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-leds-owner@vger.kernel.org; dkim=neutral (body hash did not verify) header.i=@linaro-org.20150623.gappssmtp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754539AbbLINqY (ORCPT ); Wed, 9 Dec 2015 08:46:24 -0500 Received: from mail-lf0-f50.google.com ([209.85.215.50]:34347 "EHLO mail-lf0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753083AbbLINqY (ORCPT ); Wed, 9 Dec 2015 08:46:24 -0500 Received: by lffu14 with SMTP id u14so34586882lff.1 for ; Wed, 09 Dec 2015 05:46:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=C+km7zAfVoKb1adqAFJh7tS271ZLwkFQnqAQCXG3ozQ=; b=CSDr18Anf4IMZHXj7BWEp2r/j/BUUkhlAC6Oy+dNV5pMk3dcA0Xqt6VkGBxge4IU1q rb5JgkeV8L8jDe3p/kssDQBsMLkI/Gj5fpw9JNx9BvLkJnInKl3eYQ/qTafBHQ5Wxsov WAf+sAMfcYyUQZude6aXEtiHSRUAVixXoyErFG1vi9JtkReiiaBhOJkrXxXC3jpAvl1A hJrKub3cAw57qK9LBpoXouxveP6fm73LuplulsrpKwYjittCDJzFmFBv1/VjHxQoCDZh /+tyDSXIHfEr61ggMQArT2lTvX1VShVHEqwjT8YhRNDnYbuVDKUdGlhMSuVQEaK/zk0G a7qw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=C+km7zAfVoKb1adqAFJh7tS271ZLwkFQnqAQCXG3ozQ=; b=XZoQQe7S1b4FyPRiowXQuD3G0KG38ZHveoP4nqcm1F8IhIxax3qU1fVMvNpznSqYTC Vzr8s2O8PTYT3Lb2X1/R1+eo2GnKWM3wLS5ORhW7iFe1OFVLCcR1+nuqeF1nFImlWK9D n4wV8wb0P1ze8qjLLug7Ymxlq4ccBqj1y1229ecnNu/25sLGKOa6t9Ij2cvmYxn11zt5 dVe1fKJHqXlrLKaFaSwg/INNycQ4+kxlzS6AclgE6G6fvgopemODDZ0oWyCd86ie+A27 EV0Yw4XFqBVvkYnkrYHrhwO4WtKriq97e+a0Lpl9cE0qqDh2qcsLratkPtxbBupCNghB L/6g== X-Gm-Message-State: ALoCoQncPBpbEB+4t9BrO2SesPH8HovhbYOcWzrp4AuKpFCJM9qG0Drkq9bVK0+3as45W7Hj3EBwcY3KypJYvcdhn7z5qVl/PA== X-Received: by 10.25.165.141 with SMTP id o135mr2224391lfe.139.1449668782734; Wed, 09 Dec 2015 05:46:22 -0800 (PST) Received: from localhost.localdomain ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id j204sm1411605lfd.16.2015.12.09.05.46.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 Dec 2015 05:46:22 -0800 (PST) From: Linus Walleij To: linux-gpio@vger.kernel.org, Johan Hovold , Alexandre Courbot , Michael Welling , Markus Pargmann , Riku Voipio , Richard Purdie , Jacek Anaszewski Cc: Linus Walleij , linux-leds@vger.kernel.org Subject: [PATCH 159/182] leds: tca6507: use gpiochip data pointer Date: Wed, 9 Dec 2015 14:46:18 +0100 Message-Id: <1449668778-5980-1-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 2.4.3 Sender: linux-leds-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-leds@vger.kernel.org This makes the driver use the data pointer added to the gpio_chip to store a pointer to the state container instead of relying on container_of(). Cc: Riku Voipio Cc: Richard Purdie Cc: Jacek Anaszewski Cc: linux-leds@vger.kernel.org Signed-off-by: Linus Walleij --- LEDS people: please ACK this so I can merge it in the GPIO tree. --- drivers/leds/leds-tca6507.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.4.3 -- To unsubscribe from this list: send the line "unsubscribe linux-leds" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/leds/leds-tca6507.c b/drivers/leds/leds-tca6507.c index 75529a24a615..c548ea10f0f0 100644 --- a/drivers/leds/leds-tca6507.c +++ b/drivers/leds/leds-tca6507.c @@ -603,7 +603,7 @@ static int tca6507_blink_set(struct led_classdev *led_cdev, static void tca6507_gpio_set_value(struct gpio_chip *gc, unsigned offset, int val) { - struct tca6507_chip *tca = container_of(gc, struct tca6507_chip, gpio); + struct tca6507_chip *tca = gpiochip_get_data(gc); unsigned long flags; spin_lock_irqsave(&tca->lock, flags); @@ -655,7 +655,7 @@ static int tca6507_probe_gpios(struct i2c_client *client, #ifdef CONFIG_OF_GPIO tca->gpio.of_node = of_node_get(client->dev.of_node); #endif - err = gpiochip_add(&tca->gpio); + err = gpiochip_add_data(&tca->gpio, tca); if (err) { tca->gpio.ngpio = 0; return err;