From patchwork Wed Dec 9 13:40:09 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 58097 Delivered-To: patch@linaro.org Received: by 10.112.147.194 with SMTP id tm2csp675205lbb; Wed, 9 Dec 2015 05:40:16 -0800 (PST) X-Received: by 10.66.236.229 with SMTP id ux5mr6443626pac.91.1449668416181; Wed, 09 Dec 2015 05:40:16 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id hm2si12792065pac.186.2015.12.09.05.40.15; Wed, 09 Dec 2015 05:40:16 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-gpio-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-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-gpio-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 S1754404AbbLINkP (ORCPT + 4 others); Wed, 9 Dec 2015 08:40:15 -0500 Received: from mail-lb0-f182.google.com ([209.85.217.182]:32871 "EHLO mail-lb0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752045AbbLINkO (ORCPT ); Wed, 9 Dec 2015 08:40:14 -0500 Received: by lbbkw15 with SMTP id kw15so30175634lbb.0 for ; Wed, 09 Dec 2015 05:40:12 -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=dFknQS4+YNnN0Kv6JGsPWRleE/nlW4vLORKquc+oi4M=; b=tHaZiDOqhDa+YmVyH4TXCqKvvFXRKFnPya4l0bfb87jxjDiP1iSLI3qSuhsa2yZjTj 3Om+OoaxLt1egVdyH4g2wSrAa/S/Mp/baTvGQw/QoQsrYCedBmELG+Y5KqOxzolZqZjn SSrea2JB7zZsL/LeNuvq6DyWixyt6zLKJLZ2jieAYF/ESa4aZM0Nf1zdRYyzV1cgVC99 zcTT+c1wFOFf3puiFSNphiubDdEsz1YM6G+Jg8e6QOd7t/ShS0F0yABKC8MiMgP0I6/l AYTCSg4aP8v2qTWWd/atkFCljnA0L2vROrAf3/A1jpChVrgEMsvuecqmLbXqkT6+f5Rd JKGA== 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=dFknQS4+YNnN0Kv6JGsPWRleE/nlW4vLORKquc+oi4M=; b=h8YUFblCHGRCvvzwJs8u5AwgzPQ3+I5egS3rmWgEeV9nZw8cyVygHvdD0qDcgO6xjC +WpTWaBwssm0A0ibiqa6gvpEx3lhsV3r/6BOnoII79envutaPztk5MJjSh+ksJAVTKBI Qnagavj2D+iG/OjhC1riznkMi5Lk2vmoQF4dvkLmOt7pTTyZcp3a3528BSb7QEcp4WJi hGgfyF2YEKav4mFZnRnipPV+yf4erTN4lFrZ8clJ51w82QkFkjnDGLjtrGWmPdA01IIJ tpbx39Ar9DS4oy3KWqLf1RcBWVNf91p8DxphvFbWvevsW9VhUQNByBkJJMBCmbFaoaC9 IVrA== X-Gm-Message-State: ALoCoQlA4AmQCDCf//vu8OVTjYBPUZWaU5VvN1PqDgdC77I3CHXGu0DHvCDICVgd1WuOAA29B6AbRkMUcHSV1Ag+Csgusr8NPw== X-Received: by 10.112.99.199 with SMTP id es7mr2394335lbb.25.1449668412446; Wed, 09 Dec 2015 05:40:12 -0800 (PST) Received: from localhost.localdomain ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id l67sm1444286lfl.26.2015.12.09.05.40.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 Dec 2015 05:40:11 -0800 (PST) From: Linus Walleij To: linux-gpio@vger.kernel.org, Johan Hovold , Alexandre Courbot , Michael Welling , Markus Pargmann , Ralf Baechle Cc: Linus Walleij , linux-mips@linux-mips.org Subject: [PATCH 141/182] MIPS: txx9: iocled: use gpiochip data pointer Date: Wed, 9 Dec 2015 14:40:09 +0100 Message-Id: <1449668409-4738-1-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 2.4.3 Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@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: Ralf Baechle Cc: linux-mips@linux-mips.org Signed-off-by: Linus Walleij --- Ralf: please ACK this so I can take it through the GPIO tree. BTW: would be nice if the MIPS GPIO drivers could move down to drivers/gpio in the long run. This should compile with just #include , I hope that works. --- arch/mips/txx9/generic/setup.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) -- 2.4.3 -- To unsubscribe from this list: send the line "unsubscribe linux-gpio" 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/arch/mips/txx9/generic/setup.c b/arch/mips/txx9/generic/setup.c index 9d9962ab7d25..78cffd8e63d3 100644 --- a/arch/mips/txx9/generic/setup.c +++ b/arch/mips/txx9/generic/setup.c @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include #include #include @@ -687,16 +687,14 @@ struct txx9_iocled_data { static int txx9_iocled_get(struct gpio_chip *chip, unsigned int offset) { - struct txx9_iocled_data *data = - container_of(chip, struct txx9_iocled_data, chip); + struct txx9_iocled_data *data = gpiochip_get_data(chip); return data->cur_val & (1 << offset); } static void txx9_iocled_set(struct gpio_chip *chip, unsigned int offset, int value) { - struct txx9_iocled_data *data = - container_of(chip, struct txx9_iocled_data, chip); + struct txx9_iocled_data *data = gpiochip_get_data(chip); unsigned long flags; spin_lock_irqsave(&txx9_iocled_lock, flags); if (value) @@ -749,7 +747,7 @@ void __init txx9_iocled_init(unsigned long baseaddr, iocled->chip.label = "iocled"; iocled->chip.base = basenum; iocled->chip.ngpio = num; - if (gpiochip_add(&iocled->chip)) + if (gpiochip_add_data(&iocled->chip, iocled)) goto out_unmap; if (basenum < 0) basenum = iocled->chip.base;