From: Viresh Kumar <viresh.kumar@st.com>
To: <akpm@linux-foundation.org>
Cc: <linux-kernel@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>, <mturquette@linaro.org>,
<sshtylyov@mvista.com>, <jgarzik@redhat.com>,
<linux@arm.linux.org.uk>, <spear-devel@list.st.com>,
<viresh.linux@gmail.com>, Viresh Kumar <viresh.kumar@st.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
<linux-usb@vger.kernel.org>
Subject: [PATCH V2 7/9] gadget/m66592: Remove conditional compilation of clk code
Date: Tue, 24 Apr 2012 11:26:15 +0530 [thread overview]
Message-ID: <fa347aaef380908eb154f5aa01ccf0daa933cd49.1335246730.git.viresh.kumar@st.com> (raw)
In-Reply-To: <cover.1335246730.git.viresh.kumar@st.com>
With addition of dummy clk_*() calls for non CONFIG_HAVE_CLK cases in clk.h,
there is no need to have clk code enclosed in #ifdef CONFIG_HAVE_CLK, #endif
macros.
Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-usb@vger.kernel.org
---
drivers/usb/gadget/m66592-udc.c | 19 +++++--------------
drivers/usb/gadget/m66592-udc.h | 5 -----
2 files changed, 5 insertions(+), 19 deletions(-)
diff --git a/drivers/usb/gadget/m66592-udc.c b/drivers/usb/gadget/m66592-udc.c
index 3608b3b..34eee07 100644
--- a/drivers/usb/gadget/m66592-udc.c
+++ b/drivers/usb/gadget/m66592-udc.c
@@ -1583,12 +1583,10 @@ static int __exit m66592_remove(struct platform_device *pdev)
iounmap(m66592->reg);
free_irq(platform_get_irq(pdev, 0), m66592);
m66592_free_request(&m66592->ep[0].ep, m66592->ep0_req);
-#ifdef CONFIG_HAVE_CLK
- if (m66592->pdata->on_chip) {
+ if (m66592->pdata->on_chip && !IS_ERR(m66592->clk)) {
clk_disable(m66592->clk);
clk_put(m66592->clk);
}
-#endif
kfree(m66592);
return 0;
}
@@ -1602,9 +1600,7 @@ static int __init m66592_probe(struct platform_device *pdev)
struct resource *res, *ires;
void __iomem *reg = NULL;
struct m66592 *m66592 = NULL;
-#ifdef CONFIG_HAVE_CLK
char clk_name[8];
-#endif
int ret = 0;
int i;
@@ -1671,19 +1667,17 @@ static int __init m66592_probe(struct platform_device *pdev)
goto clean_up;
}
-#ifdef CONFIG_HAVE_CLK
if (m66592->pdata->on_chip) {
snprintf(clk_name, sizeof(clk_name), "usbf%d", pdev->id);
m66592->clk = clk_get(&pdev->dev, clk_name);
if (IS_ERR(m66592->clk)) {
dev_err(&pdev->dev, "cannot get clock \"%s\"\n",
clk_name);
- ret = PTR_ERR(m66592->clk);
- goto clean_up2;
+ } else {
+ clk_enable(m66592->clk);
}
- clk_enable(m66592->clk);
}
-#endif
+
INIT_LIST_HEAD(&m66592->gadget.ep_list);
m66592->gadget.ep0 = &m66592->ep[0].ep;
INIT_LIST_HEAD(&m66592->gadget.ep0->ep_list);
@@ -1731,13 +1725,10 @@ err_add_udc:
m66592_free_request(&m66592->ep[0].ep, m66592->ep0_req);
clean_up3:
-#ifdef CONFIG_HAVE_CLK
- if (m66592->pdata->on_chip) {
+ if (m66592->pdata->on_chip && !IS_ERR(m66592->clk)) {
clk_disable(m66592->clk);
clk_put(m66592->clk);
}
-clean_up2:
-#endif
free_irq(ires->start, m66592);
clean_up:
if (m66592) {
diff --git a/drivers/usb/gadget/m66592-udc.h b/drivers/usb/gadget/m66592-udc.h
index 9d9f7e3..a044ad3 100644
--- a/drivers/usb/gadget/m66592-udc.h
+++ b/drivers/usb/gadget/m66592-udc.h
@@ -13,10 +13,7 @@
#ifndef __M66592_UDC_H__
#define __M66592_UDC_H__
-#ifdef CONFIG_HAVE_CLK
#include <linux/clk.h>
-#endif
-
#include <linux/usb/m66592.h>
#define M66592_SYSCFG 0x00
@@ -468,9 +465,7 @@ struct m66592_ep {
struct m66592 {
spinlock_t lock;
void __iomem *reg;
-#ifdef CONFIG_HAVE_CLK
struct clk *clk;
-#endif
struct m66592_platdata *pdata;
unsigned long irq_trigger;
--
1.7.9
next prev parent reply other threads:[~2012-04-24 6:09 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-24 5:56 [PATCH V2 0/9] clk: Add non CONFIG_HAVE_CLK routines Viresh Kumar
2012-04-24 5:56 ` [PATCH V2 1/9] " Viresh Kumar
2012-04-24 5:56 ` [PATCH V2 2/9] clk: Remove redundant depends on from drivers/Kconfig Viresh Kumar
2012-04-24 5:56 ` [PATCH V2 3/9] ata/pata_arasan: Remove conditional compilation of clk code Viresh Kumar
2012-04-24 5:56 ` [PATCH V2 4/9] ata/sata_mv: " Viresh Kumar
2012-04-24 5:56 ` [PATCH V2 5/9] net/c_can: " Viresh Kumar
2012-04-24 5:56 ` [PATCH V2 6/9] net/stmmac: " Viresh Kumar
2012-04-24 6:16 ` Giuseppe CAVALLARO
2012-04-24 6:33 ` Giuseppe CAVALLARO
2012-04-24 6:42 ` Viresh Kumar
2012-04-24 8:24 ` Giuseppe CAVALLARO
2012-04-24 5:56 ` Viresh Kumar [this message]
2012-04-24 5:56 ` [PATCH V2 8/9] gadget/r8a66597: " Viresh Kumar
2012-04-24 5:56 ` [PATCH V2 9/9] usb/host/r8a66597: " Viresh Kumar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=fa347aaef380908eb154f5aa01ccf0daa933cd49.1335246730.git.viresh.kumar@st.com \
--to=viresh.kumar@st.com \
--cc=akpm@linux-foundation.org \
--cc=gregkh@linuxfoundation.org \
--cc=jgarzik@redhat.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=mturquette@linaro.org \
--cc=spear-devel@list.st.com \
--cc=sshtylyov@mvista.com \
--cc=viresh.linux@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®