From patchwork Wed Mar 28 10:50:37 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Tushar Behera X-Patchwork-Id: 149258 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from mail-pb0-f56.google.com (mail-pb0-f56.google.com [209.85.160.56]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 11197B6F98 for ; Thu, 29 Mar 2012 01:58:36 +1100 (EST) Received: by pbcun4 with SMTP id un4sf1099562pbc.11 for ; Wed, 28 Mar 2012 07:58:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=beta; h=x-beenthere:received-spf:from:to:cc:subject:date:message-id :x-mailer:in-reply-to:references:mime-version:x-original-sender :x-original-authentication-results:reply-to:precedence:mailing-list :list-id:x-google-group-id:list-post:list-help:list-archive:sender :list-subscribe:list-unsubscribe:content-type :content-transfer-encoding; bh=lMxkh9CRpDZrqAogQc9m0qQ0CAqsjR8KB0rEKnLWUhE=; b=AoAPBsjk4QiQy7o3hEvus9X5jKa5qNIPyMuoAjlSKpr3NvDLwqg4HKp89SXo7kyiOd 8Cy4ZOAj/jyu6xc4X1CRcm+k9eeh7ffiwTfRYXu/mWbZJjYF/zY0NgbkzDWNTEht3+Ob US14Gx1hzRIt8HvxUEkA8bxDdKdGHd4fpZI44= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-beenthere:received-spf:from:to:cc:subject:date:message-id :x-mailer:in-reply-to:references:mime-version:x-gm-message-state :x-original-sender:x-original-authentication-results:reply-to :precedence:mailing-list:list-id:x-google-group-id:list-post :list-help:list-archive:sender:list-subscribe:list-unsubscribe :content-type:content-transfer-encoding; bh=lMxkh9CRpDZrqAogQc9m0qQ0CAqsjR8KB0rEKnLWUhE=; b=VyahVigwuWkqC7WBO6BNGNcZNC0Ae2sApLWnL3YjDdSkgLT4RW5DycazzI9fvgsHnn HcNatf3sqVCGpxdGmxNolw3+qO0LjmF5JqzuBk0CSeJT0iIh7YzNszCAQhd+5yGx5rh/ 4cxfZ6fFPLPH5OqFjC2WxwJJRS86z2lEpwSI0uW6kaFnqQILRKBcS8XvUbgaFjaPZxVn 5bzjzvzumTSUEbnZmCTAQ89MSf9epqqBTyC6HudaZmzFUVBgfyDIeqeHMj695y4ehlHL qhx2UR5xVctYMZ6m5udZ3o9jFJDiii0qes+UjpN4ReDGiZJlZmqNzNIIXNjnAmVYgvka rfsA== Received: by 10.236.175.38 with SMTP id y26mr5050006yhl.11.1332946712743; Wed, 28 Mar 2012 07:58:32 -0700 (PDT) X-BeenThere: rtc-linux@googlegroups.com Received: by 10.236.86.115 with SMTP id v79ls81451yhe.2.gmail; Wed, 28 Mar 2012 07:58:32 -0700 (PDT) Received: by 10.101.136.30 with SMTP id o30mr11209119ann.14.1332932313365; Wed, 28 Mar 2012 03:58:33 -0700 (PDT) Received: by 10.101.136.30 with SMTP id o30mr11209118ann.14.1332932313346; Wed, 28 Mar 2012 03:58:33 -0700 (PDT) Received: from mail-yx0-f172.google.com (mail-yx0-f172.google.com [209.85.213.172]) by gmr-mx.google.com with ESMTPS id g10si1659162yhn.7.2012.03.28.03.58.33 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 28 Mar 2012 03:58:33 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.213.172 is neither permitted nor denied by best guess record for domain of tushar.behera@linaro.org) client-ip=209.85.213.172; Received: by yenm5 with SMTP id m5so616941yen.31 for ; Wed, 28 Mar 2012 03:58:33 -0700 (PDT) Received: by 10.68.239.99 with SMTP id vr3mr70355708pbc.112.1332932313083; Wed, 28 Mar 2012 03:58:33 -0700 (PDT) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id g4sm2453726pbt.58.2012.03.28.03.58.29 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 28 Mar 2012 03:58:32 -0700 (PDT) From: Tushar Behera To: rtc-linux@googlegroups.com Cc: linux-samsung-soc@vger.kernel.org, a.zummo@towertech.it, kgene.kim@samsung.com, patches@linaro.org, Heiko Stuebner Subject: [rtc-linux] [PATCH 2/2] rtc: rtc-s3c: Add placeholder for driver private data Date: Wed, 28 Mar 2012 16:20:37 +0530 Message-Id: <1332931837-3819-3-git-send-email-tushar.behera@linaro.org> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1332931837-3819-1-git-send-email-tushar.behera@linaro.org> References: <1332931837-3819-1-git-send-email-tushar.behera@linaro.org> MIME-Version: 1.0 X-Gm-Message-State: ALoCoQlanPqK05Ur1SqS3Q4udMMurWG9bQwehcXRTVfcyhp3jaTwgXUpcTaB273uuNOllT7rkbGA X-Original-Sender: tushar.behera@linaro.org X-Original-Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 209.85.213.172 is neither permitted nor denied by best guess record for domain of tushar.behera@linaro.org) smtp.mail=tushar.behera@linaro.org Reply-To: rtc-linux@googlegroups.com Precedence: list Mailing-list: list rtc-linux@googlegroups.com; contact rtc-linux+owners@googlegroups.com List-ID: X-Google-Group-Id: 712029733259 List-Post: , List-Help: , List-Archive: Sender: rtc-linux@googlegroups.com List-Subscribe: , List-Unsubscribe: , Driver data field is a pointer, hence assigning that to an integer results in compilation warnings. Fixes following compilation warnigs. drivers/rtc/rtc-s3c.c: In function ‘s3c_rtc_get_driver_data’: drivers/rtc/rtc-s3c.c:452:3: warning: return makes integer from pointer without a cast [enabled by default] drivers/rtc/rtc-s3c.c: At top level: drivers/rtc/rtc-s3c.c:674:3: warning: initialization makes pointer from integer without a cast [enabled by default] drivers/rtc/rtc-s3c.c:674:3: warning: (near initialization for ‘s3c_rtc_dt_match[1].data’) [enabled by default] drivers/rtc/rtc-s3c.c:677:3: warning: initialization makes pointer from integer without a cast [enabled by default] drivers/rtc/rtc-s3c.c:677:3: warning: (near initialization for ‘s3c_rtc_dt_match[2].data’) [enabled by default] drivers/rtc/rtc-s3c.c:680:3: warning: initialization makes pointer from integer without a cast [enabled by default] drivers/rtc/rtc-s3c.c:680:3: warning: (near initialization for ‘s3c_rtc_dt_match[3].data’) [enabled by default] Cc: Heiko Stuebner Signed-off-by: Tushar Behera --- drivers/rtc/rtc-s3c.c | 23 ++++++++++++++++++----- 1 files changed, 18 insertions(+), 5 deletions(-) diff --git a/drivers/rtc/rtc-s3c.c b/drivers/rtc/rtc-s3c.c index dc6c0d2..6774a27 100644 --- a/drivers/rtc/rtc-s3c.c +++ b/drivers/rtc/rtc-s3c.c @@ -40,6 +40,10 @@ enum s3c_cpu_type { TYPE_S3C64XX, }; +struct s3c_rtc_drv_data { + int cpu_type; +}; + /* I have yet to find an S3C implementation with more than one * of these rtc blocks in */ @@ -446,10 +450,12 @@ static const struct of_device_id s3c_rtc_dt_match[]; static inline int s3c_rtc_get_driver_data(struct platform_device *pdev) { #ifdef CONFIG_OF + struct s3c_rtc_drv_data *data; if (pdev->dev.of_node) { const struct of_device_id *match; match = of_match_node(s3c_rtc_dt_match, pdev->dev.of_node); - return match->data; + data = (struct s3c_rtc_drv_data *) match->data; + return data->cpu_type; } #endif return platform_get_device_id(pdev)->driver_data; @@ -664,20 +670,27 @@ static int s3c_rtc_resume(struct platform_device *pdev) #define s3c_rtc_resume NULL #endif +static struct s3c_rtc_drv_data s3c_rtc_drv_data_array[] = { + [TYPE_S3C2410] = { TYPE_S3C2410 }, + [TYPE_S3C2416] = { TYPE_S3C2416 }, + [TYPE_S3C2443] = { TYPE_S3C2443 }, + [TYPE_S3C64XX] = { TYPE_S3C64XX }, +}; + #ifdef CONFIG_OF static const struct of_device_id s3c_rtc_dt_match[] = { { .compatible = "samsung,s3c2410-rtc", - .data = TYPE_S3C2410, + .data = &s3c_rtc_drv_data_array[TYPE_S3C2410], }, { .compatible = "samsung,s3c2416-rtc", - .data = TYPE_S3C2416, + .data = &s3c_rtc_drv_data_array[TYPE_S3C2416], }, { .compatible = "samsung,s3c2443-rtc", - .data = TYPE_S3C2443, + .data = &s3c_rtc_drv_data_array[TYPE_S3C2443], }, { .compatible = "samsung,s3c6410-rtc", - .data = TYPE_S3C64XX, + .data = &s3c_rtc_drv_data_array[TYPE_S3C64XX], }, {}, };