From: Akinobu Mita <mita@fixstars.com>
To: Christian Krafft <krafft@de.ibm.com>
Cc: "linuxppc-dev@ozlabs.org" <linuxppc-dev@ozlabs.org>,
"cbe-oss-dev@ozlabs.org" <cbe-oss-dev@ozlabs.org>
Subject: Re: [Cbe-oss-dev] [patch 1/5] cell: pmi remove support for mutiple devices.
Date: Thu, 21 Jun 2007 23:07:31 +0900 [thread overview]
Message-ID: <20070621140731.GA24496@ps3linux.grid.fixstars.com> (raw)
In-Reply-To: <20070621131644.03a8ec31@localhost>
> Index: linux/arch/powerpc/sysdev/pmi.c
> ===================================================================
> --- linux.orig/arch/powerpc/sysdev/pmi.c
> +++ linux/arch/powerpc/sysdev/pmi.c
> @@ -48,15 +48,13 @@ struct pmi_data {
> struct work_struct work;
> };
>
> +static struct pmi_data *data;
>
[...]
> @@ -129,9 +124,14 @@ static int pmi_of_probe(struct of_device
> const struct of_device_id *match)
> {
> struct device_node *np = dev->node;
> - struct pmi_data *data;
> int rc;
>
> + if (data) {
> + printk(KERN_ERR "pmi: driver has already been initialized.\n");
> + rc = -EBUSY;
> + goto out;
> + }
> +
> data = kzalloc(sizeof(struct pmi_data), GFP_KERNEL);
> if (!data) {
> printk(KERN_ERR "pmi: could not allocate memory.\n");
> @@ -154,7 +154,6 @@ static int pmi_of_probe(struct of_device
>
> INIT_WORK(&data->work, pmi_notify_handlers);
>
> - dev->dev.driver_data = data;
> data->dev = dev;
>
> data->irq = irq_of_parse_and_map(np, 0);
> @@ -164,7 +163,7 @@ static int pmi_of_probe(struct of_device
> goto error_cleanup_iomap;
> }
>
> - rc = request_irq(data->irq, pmi_irq_handler, 0, "pmi", data);
> + rc = request_irq(data->irq, pmi_irq_handler, 0, "pmi", NULL);
> if (rc) {
> printk(KERN_ERR "pmi: can't request IRQ %d: returned %d\n",
> data->irq, rc);
> @@ -187,11 +186,8 @@ out:
>
> static int pmi_of_remove(struct of_device *dev)
> {
> - struct pmi_data *data;
> struct pmi_handler *handler, *tmp;
>
> - data = dev->dev.driver_data;
> -
> free_irq(data->irq, data);
> iounmap(data->pmi_reg);
>
> @@ -202,7 +198,7 @@ static int pmi_of_remove(struct of_devic
>
> spin_unlock(&data->handler_spinlock);
>
> - kfree(dev->dev.driver_data);
> + kfree(data);
Shouldn't it set data = NULL here?
I guess we will get "pmi: driver has already been initialized" message
and -EBUSY on reloading pmi driver.
>
> return 0;
> }
next prev parent reply other threads:[~2007-06-21 14:35 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-21 11:09 [patch 0/5] cell: cpufreq and pmi patches Christian Krafft
2007-06-21 11:16 ` [patch 1/5] cell: pmi remove support for mutiple devices Christian Krafft
2007-06-21 14:07 ` Akinobu Mita [this message]
2007-06-22 14:10 ` [Cbe-oss-dev] " Christian Krafft
2007-06-25 1:44 ` Akinobu Mita
2007-06-22 16:00 ` Resend: " Christian Krafft
2007-06-21 11:20 ` [patch 2/5] cell: cbe_cpufreq fix latency measurement Christian Krafft
2007-06-21 11:23 ` [patch 3/5] cell: cbe_cpufreq: fix initialization Christian Krafft
2007-06-21 11:26 ` [patch 4/5] cell: cpufreq and pmi patches Christian Krafft
2007-06-21 11:41 ` [patch 5/5] cell: cbe_cpufreq: reorganize code Christian Krafft
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=20070621140731.GA24496@ps3linux.grid.fixstars.com \
--to=mita@fixstars.com \
--cc=cbe-oss-dev@ozlabs.org \
--cc=krafft@de.ibm.com \
--cc=linuxppc-dev@ozlabs.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).