From patchwork Sat Feb 23 11:57:43 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Heiko_St=C3=BCbner?= X-Patchwork-Id: 2178341 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id ED04E3FCF6 for ; Sat, 23 Feb 2013 12:38:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758852Ab3BWMid (ORCPT ); Sat, 23 Feb 2013 07:38:33 -0500 Received: from gloria.sntech.de ([95.129.55.99]:53430 "EHLO gloria.sntech.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758839Ab3BWMic (ORCPT ); Sat, 23 Feb 2013 07:38:32 -0500 Received: from 178-25-111-196-dynip.superkabel.de ([178.25.111.196] helo=marty.localnet) by gloria.sntech.de with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.72) (envelope-from ) id 1U9Djd-0004ct-6h; Sat, 23 Feb 2013 12:57:45 +0100 From: Heiko =?utf-8?q?St=C3=BCbner?= To: Dmitry Torokhov Subject: [PATCH 3/4] Input: auo_pixcir_ts - keep own pointer to platform_data Date: Sat, 23 Feb 2013 12:57:43 +0100 User-Agent: KMail/1.13.7 (Linux/3.2.0-3-686-pae; KDE/4.8.4; i686; ; ) Cc: Grant Likely , Rob Herring , linux-input@vger.kernel.org, devicetree-discuss@lists.ozlabs.org References: <201302231255.23772.heiko@sntech.de> In-Reply-To: <201302231255.23772.heiko@sntech.de> MIME-Version: 1.0 Message-Id: <201302231257.43936.heiko@sntech.de> Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org When supporting devicetree the platformdata may not necessarily come from the dev but may be generated in the driver instead. Therefore keep the pointer in the driver struct instead of using dev.platform_data. Signed-off-by: Heiko Stuebner --- drivers/input/touchscreen/auo-pixcir-ts.c | 11 ++++++----- 1 files changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/input/touchscreen/auo-pixcir-ts.c b/drivers/input/touchscreen/auo-pixcir-ts.c index 6317a9c..c0a2483 100644 --- a/drivers/input/touchscreen/auo-pixcir-ts.c +++ b/drivers/input/touchscreen/auo-pixcir-ts.c @@ -111,6 +111,7 @@ struct auo_pixcir_ts { struct i2c_client *client; struct input_dev *input; + const struct auo_pixcir_ts_platdata *pdata; char phys[32]; /* special handling for touch_indicate interupt mode */ @@ -132,7 +133,7 @@ static int auo_pixcir_collect_data(struct auo_pixcir_ts *ts, struct auo_point_t *point) { struct i2c_client *client = ts->client; - const struct auo_pixcir_ts_platdata *pdata = client->dev.platform_data; + const struct auo_pixcir_ts_platdata *pdata = ts->pdata; uint8_t raw_coord[8]; uint8_t raw_area[4]; int i, ret; @@ -178,8 +179,7 @@ static int auo_pixcir_collect_data(struct auo_pixcir_ts *ts, static irqreturn_t auo_pixcir_interrupt(int irq, void *dev_id) { struct auo_pixcir_ts *ts = dev_id; - struct i2c_client *client = ts->client; - const struct auo_pixcir_ts_platdata *pdata = client->dev.platform_data; + const struct auo_pixcir_ts_platdata *pdata = ts->pdata; struct auo_point_t point[AUO_PIXCIR_REPORT_POINTS]; int i; int ret; @@ -290,7 +290,7 @@ static int auo_pixcir_int_config(struct auo_pixcir_ts *ts, int int_setting) { struct i2c_client *client = ts->client; - struct auo_pixcir_ts_platdata *pdata = client->dev.platform_data; + const struct auo_pixcir_ts_platdata *pdata = ts->pdata; int ret; ret = i2c_smbus_read_byte_data(client, AUO_PIXCIR_REG_INT_SETTING); @@ -527,6 +527,7 @@ static int auo_pixcir_probe(struct i2c_client *client, msleep(200); + ts->pdata = pdata; ts->client = client; ts->touch_ind_mode = 0; init_waitqueue_head(&ts->wait); @@ -624,7 +625,7 @@ err_gpio_int: static int auo_pixcir_remove(struct i2c_client *client) { struct auo_pixcir_ts *ts = i2c_get_clientdata(client); - const struct auo_pixcir_ts_platdata *pdata = client->dev.platform_data; + const struct auo_pixcir_ts_platdata *pdata = ts->pdata; free_irq(client->irq, ts);