Commit 1aa2d1da authored by Marc Kleine-Budde's avatar Marc Kleine-Budde Committed by David S. Miller

can: c_can_pci: fix compilation on non HAVE_CLK archs

In commit:

  5b92da04 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: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 41063e9d
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/netdevice.h> #include <linux/netdevice.h>
#include <linux/clk.h>
#include <linux/pci.h> #include <linux/pci.h>
#include <linux/can/dev.h> #include <linux/can/dev.h>
...@@ -30,7 +29,7 @@ struct c_can_pci_data { ...@@ -30,7 +29,7 @@ struct c_can_pci_data {
enum c_can_dev_id type; enum c_can_dev_id type;
/* Set the register alignment in the memory */ /* Set the register alignment in the memory */
enum c_can_pci_reg_align reg_align; enum c_can_pci_reg_align reg_align;
/* Set the frequency if clk is not usable */ /* Set the frequency */
unsigned int freq; unsigned int freq;
}; };
...@@ -71,7 +70,6 @@ static int __devinit c_can_pci_probe(struct pci_dev *pdev, ...@@ -71,7 +70,6 @@ static int __devinit c_can_pci_probe(struct pci_dev *pdev,
struct c_can_priv *priv; struct c_can_priv *priv;
struct net_device *dev; struct net_device *dev;
void __iomem *addr; void __iomem *addr;
struct clk *clk;
int ret; int ret;
ret = pci_enable_device(pdev); ret = pci_enable_device(pdev);
...@@ -113,18 +111,11 @@ static int __devinit c_can_pci_probe(struct pci_dev *pdev, ...@@ -113,18 +111,11 @@ static int __devinit c_can_pci_probe(struct pci_dev *pdev,
priv->base = addr; priv->base = addr;
if (!c_can_pci_data->freq) { if (!c_can_pci_data->freq) {
/* get the appropriate clk */ dev_err(&pdev->dev, "no clock frequency defined\n");
clk = clk_get(&pdev->dev, NULL); ret = -ENODEV;
if (IS_ERR(clk)) { goto out_free_c_can;
dev_err(&pdev->dev, "no clock defined\n");
ret = -ENODEV;
goto out_free_c_can;
}
priv->can.clock.freq = clk_get_rate(clk);
priv->priv = clk;
} else { } else {
priv->can.clock.freq = c_can_pci_data->freq; priv->can.clock.freq = c_can_pci_data->freq;
priv->priv = NULL;
} }
/* Configure CAN type */ /* Configure CAN type */
...@@ -138,7 +129,7 @@ static int __devinit c_can_pci_probe(struct pci_dev *pdev, ...@@ -138,7 +129,7 @@ static int __devinit c_can_pci_probe(struct pci_dev *pdev,
break; break;
default: default:
ret = -EINVAL; ret = -EINVAL;
goto out_free_clock; goto out_free_c_can;
} }
/* Configure access to registers */ /* Configure access to registers */
...@@ -153,14 +144,14 @@ static int __devinit c_can_pci_probe(struct pci_dev *pdev, ...@@ -153,14 +144,14 @@ static int __devinit c_can_pci_probe(struct pci_dev *pdev,
break; break;
default: default:
ret = -EINVAL; ret = -EINVAL;
goto out_free_clock; goto out_free_c_can;
} }
ret = register_c_can_dev(dev); ret = register_c_can_dev(dev);
if (ret) { if (ret) {
dev_err(&pdev->dev, "registering %s failed (err=%d)\n", dev_err(&pdev->dev, "registering %s failed (err=%d)\n",
KBUILD_MODNAME, ret); KBUILD_MODNAME, ret);
goto out_free_clock; goto out_free_c_can;
} }
dev_dbg(&pdev->dev, "%s device registered (regs=%p, irq=%d)\n", 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,9 +159,6 @@ static int __devinit c_can_pci_probe(struct pci_dev *pdev,
return 0; return 0;
out_free_clock:
if (priv->priv)
clk_put(priv->priv);
out_free_c_can: out_free_c_can:
pci_set_drvdata(pdev, NULL); pci_set_drvdata(pdev, NULL);
free_c_can_dev(dev); free_c_can_dev(dev);
...@@ -193,9 +181,6 @@ static void __devexit c_can_pci_remove(struct pci_dev *pdev) ...@@ -193,9 +181,6 @@ static void __devexit c_can_pci_remove(struct pci_dev *pdev)
unregister_c_can_dev(dev); unregister_c_can_dev(dev);
if (priv->priv)
clk_put(priv->priv);
pci_set_drvdata(pdev, NULL); pci_set_drvdata(pdev, NULL);
free_c_can_dev(dev); free_c_can_dev(dev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment