diff options
author | Marc Kleine-Budde <mkl@pengutronix.de> | 2012-06-20 02:04:26 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-06-20 16:46:29 -0400 |
commit | 1aa2d1daf067c8c9e625449e2e6f54caa3e34023 (patch) | |
tree | 41abc4a03a50aede07e2f59021494894d9716d32 | |
parent | 41063e9dd11956f2d285e12e4342e1d232ba0ea2 (diff) |
can: c_can_pci: fix compilation on non HAVE_CLK archs
In commit:
5b92da0 c_can_pci: generic module for C_CAN/D_CAN on PCI
the c_can_pci driver has been added. It uses clk_*() functions
resulting in a link error on archs without clock support. This
patch removed these clk_() functions as these parts of the driver
are not tested.
Cc: Federico Vaga <federico.vaga@gmail.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/can/c_can/c_can_pci.c | 29 |
1 files changed, 7 insertions, 22 deletions
diff --git a/drivers/net/can/c_can/c_can_pci.c b/drivers/net/can/c_can/c_can_pci.c index 914aecfa09a9..1011146ea513 100644 --- a/drivers/net/can/c_can/c_can_pci.c +++ b/drivers/net/can/c_can/c_can_pci.c | |||
@@ -13,7 +13,6 @@ | |||
13 | #include <linux/kernel.h> | 13 | #include <linux/kernel.h> |
14 | #include <linux/module.h> | 14 | #include <linux/module.h> |
15 | #include <linux/netdevice.h> | 15 | #include <linux/netdevice.h> |
16 | #include <linux/clk.h> | ||
17 | #include <linux/pci.h> | 16 | #include <linux/pci.h> |
18 | 17 | ||
19 | #include <linux/can/dev.h> | 18 | #include <linux/can/dev.h> |
@@ -30,7 +29,7 @@ struct c_can_pci_data { | |||
30 | enum c_can_dev_id type; | 29 | enum c_can_dev_id type; |
31 | /* Set the register alignment in the memory */ | 30 | /* Set the register alignment in the memory */ |
32 | enum c_can_pci_reg_align reg_align; | 31 | enum c_can_pci_reg_align reg_align; |
33 | /* Set the frequency if clk is not usable */ | 32 | /* Set the frequency */ |
34 | unsigned int freq; | 33 | unsigned int freq; |
35 | }; | 34 | }; |
36 | 35 | ||
@@ -71,7 +70,6 @@ static int __devinit c_can_pci_probe(struct pci_dev *pdev, | |||
71 | struct c_can_priv *priv; | 70 | struct c_can_priv *priv; |
72 | struct net_device *dev; | 71 | struct net_device *dev; |
73 | void __iomem *addr; | 72 | void __iomem *addr; |
74 | struct clk *clk; | ||
75 | int ret; | 73 | int ret; |
76 | 74 | ||
77 | ret = pci_enable_device(pdev); | 75 | ret = pci_enable_device(pdev); |
@@ -113,18 +111,11 @@ static int __devinit c_can_pci_probe(struct pci_dev *pdev, | |||
113 | priv->base = addr; | 111 | priv->base = addr; |
114 | 112 | ||
115 | if (!c_can_pci_data->freq) { | 113 | if (!c_can_pci_data->freq) { |
116 | /* get the appropriate clk */ | 114 | dev_err(&pdev->dev, "no clock frequency defined\n"); |
117 | clk = clk_get(&pdev->dev, NULL); | 115 | ret = -ENODEV; |
118 | if (IS_ERR(clk)) { | 116 | goto out_free_c_can; |
119 | dev_err(&pdev->dev, "no clock defined\n"); | ||
120 | ret = -ENODEV; | ||
121 | goto out_free_c_can; | ||
122 | } | ||
123 | priv->can.clock.freq = clk_get_rate(clk); | ||
124 | priv->priv = clk; | ||
125 | } else { | 117 | } else { |
126 | priv->can.clock.freq = c_can_pci_data->freq; | 118 | priv->can.clock.freq = c_can_pci_data->freq; |
127 | priv->priv = NULL; | ||
128 | } | 119 | } |
129 | 120 | ||
130 | /* Configure CAN type */ | 121 | /* Configure CAN type */ |
@@ -138,7 +129,7 @@ static int __devinit c_can_pci_probe(struct pci_dev *pdev, | |||
138 | break; | 129 | break; |
139 | default: | 130 | default: |
140 | ret = -EINVAL; | 131 | ret = -EINVAL; |
141 | goto out_free_clock; | 132 | goto out_free_c_can; |
142 | } | 133 | } |
143 | 134 | ||
144 | /* Configure access to registers */ | 135 | /* Configure access to registers */ |
@@ -153,14 +144,14 @@ static int __devinit c_can_pci_probe(struct pci_dev *pdev, | |||
153 | break; | 144 | break; |
154 | default: | 145 | default: |
155 | ret = -EINVAL; | 146 | ret = -EINVAL; |
156 | goto out_free_clock; | 147 | goto out_free_c_can; |
157 | } | 148 | } |
158 | 149 | ||
159 | ret = register_c_can_dev(dev); | 150 | ret = register_c_can_dev(dev); |
160 | if (ret) { | 151 | if (ret) { |
161 | dev_err(&pdev->dev, "registering %s failed (err=%d)\n", | 152 | dev_err(&pdev->dev, "registering %s failed (err=%d)\n", |
162 | KBUILD_MODNAME, ret); | 153 | KBUILD_MODNAME, ret); |
163 | goto out_free_clock; | 154 | goto out_free_c_can; |
164 | } | 155 | } |
165 | 156 | ||
166 | dev_dbg(&pdev->dev, "%s device registered (regs=%p, irq=%d)\n", | 157 | dev_dbg(&pdev->dev, "%s device registered (regs=%p, irq=%d)\n", |
@@ -168,9 +159,6 @@ static int __devinit c_can_pci_probe(struct pci_dev *pdev, | |||
168 | 159 | ||
169 | return 0; | 160 | return 0; |
170 | 161 | ||
171 | out_free_clock: | ||
172 | if (priv->priv) | ||
173 | clk_put(priv->priv); | ||
174 | out_free_c_can: | 162 | out_free_c_can: |
175 | pci_set_drvdata(pdev, NULL); | 163 | pci_set_drvdata(pdev, NULL); |
176 | free_c_can_dev(dev); | 164 | free_c_can_dev(dev); |
@@ -193,9 +181,6 @@ static void __devexit c_can_pci_remove(struct pci_dev *pdev) | |||
193 | 181 | ||
194 | unregister_c_can_dev(dev); | 182 | unregister_c_can_dev(dev); |
195 | 183 | ||
196 | if (priv->priv) | ||
197 | clk_put(priv->priv); | ||
198 | |||
199 | pci_set_drvdata(pdev, NULL); | 184 | pci_set_drvdata(pdev, NULL); |
200 | free_c_can_dev(dev); | 185 | free_c_can_dev(dev); |
201 | 186 | ||