From patchwork Tue Nov 17 15:42:23 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 38649 X-Patchwork-Delegate: grant.likely@secretlab.ca Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from bilbo.ozlabs.org (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id E6FB3100E30 for ; Wed, 18 Nov 2009 02:43:06 +1100 (EST) Received: by ozlabs.org (Postfix) id 88357B7BC1; Wed, 18 Nov 2009 02:42:40 +1100 (EST) Delivered-To: linuxppc-dev@ozlabs.org Received: from mail-fx0-f215.google.com (mail-fx0-f215.google.com [209.85.220.215]) by ozlabs.org (Postfix) with ESMTP id C8610B7B78 for ; Wed, 18 Nov 2009 02:42:39 +1100 (EST) Received: by fxm7 with SMTP id 7so111947fxm.9 for ; Tue, 17 Nov 2009 07:42:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:date :message-id:x-mailer:in-reply-to:references; bh=QXZY+zEL+pXrMlMcwjVjZIfRiOgc/86YGK7BMJSfKyQ=; b=u66af4peVIOH6RIzHKYZpt5yTzRiMcE5NAXr2gjrWh4Z92qpd+MWkfxao3R0PIDbNY 3MpE19cVoWjz+VM634BZNajgWaO7WH8rs4Bt48UvxbQsYWuNkWyUNYlXRQyHvV3uzN2p 0fAptffehc6PQ+jlJCbSAYpDok27hqBaSMwUQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=E+2LbJL0XAS/uIIRbeU8NfTgCVkCSLszgY2AMBqpvVRiEiV7G0nbWQeir0/QjD3EAO uwxwSAXqHBCstCJh2lM20UxqOOYo18t34UcvYyDM297UyqMkHBJsSYe6BWmfXiMbSPQO S2BZvaiERdEbc76etjq/QY0wEZ0JnUKvFDft8= Received: by 10.86.170.4 with SMTP id s4mr166284fge.9.1258472557681; Tue, 17 Nov 2009 07:42:37 -0800 (PST) Received: from localhost.localdomain ([91.213.169.4]) by mx.google.com with ESMTPS id e11sm1446370fga.2.2009.11.17.07.42.35 (version=SSLv3 cipher=RC4-MD5); Tue, 17 Nov 2009 07:42:36 -0800 (PST) From: Dmitry Eremin-Solenikov To: devicetree-discuss@lists.ozlabs.org, linuxppc-dev@ozlabs.org Subject: [RFC PATCH 2/5] mcu_mpc8349emitx: port to new of gpio interface Date: Tue, 17 Nov 2009 18:42:23 +0300 Message-Id: <1258472546-31343-3-git-send-email-dbaryshkov@gmail.com> X-Mailer: git-send-email 1.6.5 In-Reply-To: <1258472546-31343-1-git-send-email-dbaryshkov@gmail.com> References: <1258472546-31343-1-git-send-email-dbaryshkov@gmail.com> Cc: David Brownell , Paul Mackerras X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Signed-off-by: Dmitry Eremin-Solenikov --- arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c | 11 +++++------ 1 files changed, 5 insertions(+), 6 deletions(-) diff --git a/arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c b/arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c index 82a9bcb..4ba8b16 100644 --- a/arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c +++ b/arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c @@ -36,7 +36,7 @@ struct mcu { struct mutex lock; struct device_node *np; struct i2c_client *client; - struct of_gpio_chip of_gc; + struct gpio_chip gc; u8 reg_ctrl; }; @@ -55,8 +55,7 @@ static void mcu_power_off(void) static void mcu_gpio_set(struct gpio_chip *gc, unsigned int gpio, int val) { - struct of_gpio_chip *of_gc = to_of_gpio_chip(gc); - struct mcu *mcu = container_of(of_gc, struct mcu, of_gc); + struct mcu *mcu = container_of(gc, struct mcu, gc); u8 bit = 1 << (4 + gpio); mutex_lock(&mcu->lock); @@ -78,8 +77,8 @@ static int mcu_gpio_dir_out(struct gpio_chip *gc, unsigned int gpio, int val) static int mcu_gpiochip_add(struct mcu *mcu) { struct device_node *np; - struct of_gpio_chip *of_gc = &mcu->of_gc; - struct gpio_chip *gc = &of_gc->gc; + struct gpio_chip *gc = &mcu->gc; + struct of_gpio_chip *of_gc = &gc->of_gc; int ret; np = of_find_compatible_node(NULL, NULL, "fsl,mcu-mpc8349emitx"); @@ -113,7 +112,7 @@ static int mcu_gpiochip_remove(struct mcu *mcu) { int ret; - ret = gpiochip_remove(&mcu->of_gc.gc); + ret = gpiochip_remove(&mcu->gc); if (ret) return ret; of_node_put(mcu->np);