From: Marc Kleine-Budde <mkl@pengutronix.de>
To: Marc Kleine-Budde <mkl@pengutronix.de>
Cc: linux-can@vger.kernel.org, Federico Vaga <federico.vaga@gmail.com>
Subject: Re: [PATCH] can: c_can_pci: fix compilation on non HAVE_CLK archs
Date: Wed, 20 Jun 2012 15:04:09 +0200 [thread overview]
Message-ID: <4FE1CA49.3010503@pengutronix.de> (raw)
In-Reply-To: <1340187910-3437-1-git-send-email-mkl@pengutronix.de>
[-- Attachment #1: Type: text/plain, Size: 3888 bytes --]
Hello Federico,
have you found Time to test the patch?
Marc
On 06/20/2012 12:25 PM, Marc Kleine-Budde wrote:
> 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
> hasn't been tested.
>
> Cc: Federico Vaga <federico.vaga@gmail.com>
> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
> ---
> Hello Federico,
>
> please test on your hardware. If it works please send me your:
> Tested-by.
>
> Thanks, Marc
>
> drivers/net/can/c_can/c_can_pci.c | 29 +++++++----------------------
> 1 file 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 914aecf..1011146 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 @@
> #include <linux/kernel.h>
> #include <linux/module.h>
> #include <linux/netdevice.h>
> -#include <linux/clk.h>
> #include <linux/pci.h>
>
> #include <linux/can/dev.h>
> @@ -30,7 +29,7 @@ struct c_can_pci_data {
> enum c_can_dev_id type;
> /* Set the register alignment in the memory */
> enum c_can_pci_reg_align reg_align;
> - /* Set the frequency if clk is not usable */
> + /* Set the frequency */
> unsigned int freq;
> };
>
> @@ -71,7 +70,6 @@ static int __devinit c_can_pci_probe(struct pci_dev *pdev,
> struct c_can_priv *priv;
> struct net_device *dev;
> void __iomem *addr;
> - struct clk *clk;
> int ret;
>
> ret = pci_enable_device(pdev);
> @@ -113,18 +111,11 @@ static int __devinit c_can_pci_probe(struct pci_dev *pdev,
> priv->base = addr;
>
> if (!c_can_pci_data->freq) {
> - /* get the appropriate clk */
> - clk = clk_get(&pdev->dev, NULL);
> - if (IS_ERR(clk)) {
> - 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;
> + dev_err(&pdev->dev, "no clock frequency defined\n");
> + ret = -ENODEV;
> + goto out_free_c_can;
> } else {
> priv->can.clock.freq = c_can_pci_data->freq;
> - priv->priv = NULL;
> }
>
> /* Configure CAN type */
> @@ -138,7 +129,7 @@ static int __devinit c_can_pci_probe(struct pci_dev *pdev,
> break;
> default:
> ret = -EINVAL;
> - goto out_free_clock;
> + goto out_free_c_can;
> }
>
> /* Configure access to registers */
> @@ -153,14 +144,14 @@ static int __devinit c_can_pci_probe(struct pci_dev *pdev,
> break;
> default:
> ret = -EINVAL;
> - goto out_free_clock;
> + goto out_free_c_can;
> }
>
> ret = register_c_can_dev(dev);
> if (ret) {
> dev_err(&pdev->dev, "registering %s failed (err=%d)\n",
> KBUILD_MODNAME, ret);
> - goto out_free_clock;
> + goto out_free_c_can;
> }
>
> 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,
>
> return 0;
>
> -out_free_clock:
> - if (priv->priv)
> - clk_put(priv->priv);
> out_free_c_can:
> pci_set_drvdata(pdev, NULL);
> free_c_can_dev(dev);
> @@ -193,9 +181,6 @@ static void __devexit c_can_pci_remove(struct pci_dev *pdev)
>
> unregister_c_can_dev(dev);
>
> - if (priv->priv)
> - clk_put(priv->priv);
> -
> pci_set_drvdata(pdev, NULL);
> free_c_can_dev(dev);
>
--
Pengutronix e.K. | Marc Kleine-Budde |
Industrial Linux Solutions | Phone: +49-231-2826-924 |
Vertretung West/Dortmund | Fax: +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de |
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 262 bytes --]
next prev parent reply other threads:[~2012-06-20 13:04 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-20 10:25 [PATCH] can: c_can_pci: fix compilation on non HAVE_CLK archs Marc Kleine-Budde
2012-06-20 13:04 ` Marc Kleine-Budde [this message]
[not found] ` <CAH5GJ0pGNx9qD6snF1d0J7QYpreapA2KaPdieKL_z06CdjHYVg@mail.gmail.com>
2012-06-20 18:24 ` Marc Kleine-Budde
2012-06-21 17:51 ` Federico Vaga
2012-06-21 17:50 ` Marc Kleine-Budde
2012-06-21 18:11 ` Federico Vaga
2012-06-22 11:42 ` Federico Vaga
2012-06-22 11:40 ` Marc Kleine-Budde
-- strict thread matches above, loose matches on Subject: below --
2012-06-20 15:58 Marc Kleine-Budde
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=4FE1CA49.3010503@pengutronix.de \
--to=mkl@pengutronix.de \
--cc=federico.vaga@gmail.com \
--cc=linux-can@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).