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: 7508 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 9CCEF23E12 for ; Wed, 28 Mar 2012 10:58:34 +0000 (UTC) Received: from mail-iy0-f180.google.com (mail-iy0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id 65ACDA18466 for ; Wed, 28 Mar 2012 10:58:34 +0000 (UTC) Received: by mail-iy0-f180.google.com with SMTP id e36so1764156iag.11 for ; Wed, 28 Mar 2012 03:58:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :mime-version:content-type:content-transfer-encoding :x-gm-message-state; bh=gMNekLRo8XUh9b2WxFyEKmIm7jlGggYzPeQdvE2kNPw=; b=Ln2gPDbaZYeEAvMSyt64Hr0NP/57fWFEE2GDZy+iEjFeqovjpJ7WjUFKCjrrPGjVdG ia7p9gvjuc5v9jJB7Q+TxD3pEJXAtMJPyyJwshJ86tmYZkwTx5+kbF/yG6ci0dpcf4Se vcV7hP41hm1re4xdBpT/NWr040ZGHFqqHtFxJFGauG11Q5PFHHg1xqAJPC5ubIHlF7EI ZDTdsEtvGlt515W4r+l/C7NtMjhwJG6vSEu5lC6vQ9C5LqUkVMNDGsvenxW1pLs1hAgm fgXc4MBDomJgS1rq7siNXxP0+DUDUwH2oo3Q3nwL/2UhV7Ho3t09+gTzWsKuLzw4hI3r FPgQ== Received: by 10.50.191.233 with SMTP id hb9mr1708572igc.44.1332932314221; Wed, 28 Mar 2012 03:58:34 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.231.5.205 with SMTP id 13csp46332ibw; Wed, 28 Mar 2012 03:58:33 -0700 (PDT) Received: by 10.68.125.226 with SMTP id mt2mr70393710pbb.38.1332932313316; Wed, 28 Mar 2012 03:58:33 -0700 (PDT) Received: from mail-pb0-f50.google.com (mail-pb0-f50.google.com [209.85.160.50]) by mx.google.com with ESMTPS id 9si3846643pbr.318.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.160.50 is neither permitted nor denied by best guess record for domain of tushar.behera@linaro.org) client-ip=209.85.160.50; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.160.50 is neither permitted nor denied by best guess record for domain of tushar.behera@linaro.org) smtp.mail=tushar.behera@linaro.org Received: by mail-pb0-f50.google.com with SMTP id xa12so1907562pbc.37 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: [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: ALoCoQl3SjWHdkKYItmMnDWYeUndtkmcZruFBNvP+aR1h3EQfKgu4BMZt8pW7xjGOAZAODCHpT0Z 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], }, {}, };