From: Samuel Ortiz on
Hi Florian,

My comments below:

On Thu, Mar 11, 2010 at 09:42:09AM +0100, Florian Fainelli wrote:
> +
> +static struct pci_dev *rdc321x_sb_pdev;
That's not very nice. I would have prefered to pass the pci_dev pointer along
with the platform data to the gpio and watchdog drivers. And then those could
call pci_read_config_dword() directly.


> +/*
> + * Unlocked PCI configuration space accessors
> + */
> +int rdc321x_pci_read(int reg, u32 *val)
> +{
> + int err;
> +
> + err = pci_read_config_dword(rdc321x_sb_pdev, reg, val);
> + if (err)
> + return err;
> +
> + return err;
If you want to keep your static pci_dev pointer around, please replace this
routine with:

int rdc321x_pci_read(int reg, u32 *val)
{
return pci_read_config_dword(rdc321x_sb_pdev, reg, val);
}


> +EXPORT_SYMBOL(rdc321x_pci_read);
> +
> +int rdc321x_pci_write(int reg, u32 val)
> +{
> + int err;
> +
> + err = pci_write_config_dword(rdc321x_sb_pdev, reg, val);
> + if (err)
> + return err;
> +
> + return err;
> +}
Ditto.

> +static int __devinit rdc321x_sb_probe(struct pci_dev *pdev,
> + const struct pci_device_id *ent)
> +{
> + int err;
> +
> + err = pci_enable_device(pdev);
> + if (err) {
> + printk(KERN_ERR "failed to enable device\n");
Please use dev_err()

> --- /dev/null
> +++ b/include/linux/mfd/rdc321x.h
> @@ -0,0 +1,24 @@
> +#ifndef __RDC321X_MFD_H
> +#define __RDC321X_MFD_H
> +
> +#include <linux/types.h>
> +
> +/* Offsets to be accessed in the southbridge PCI
> + * device configuration register */
> +#define RDC321X_WDT_CTRL 0x44
> +#define RDC321X_GPIO_CTRL_REG1 0x48
> +#define RDC321X_GPIO_DATA_REG1 0x4c
> +#define RDC321X_GPIO_CTRL_REG2 0x84
> +#define RDC321X_GPIO_DATA_REG2 0x88
> +
> +#define RDC321X_MAX_GPIO 58
As Wim pointed out, moving those definitions from rdc321x_defs.h to here
should be done in one patch, to avoid bisection breakage.
So, please merge the first patch of your serie with this one, and add a
watchdog driver fix that includes inux/mfd/rdc321x.h instead of
rdc321x_defs.h.

Cheers,
Samuel.


> +/* Definitions for the shared southbridge accessors */
> +int rdc321x_pci_write(int reg, u32 val);
> +int rdc321x_pci_read(int reg, u32 *val);
> +
> +struct rdc321x_gpio_pdata {
> + unsigned max_gpios;
> +};
> +
> +#endif /* __RDC321X_MFD_H */

--
Intel Open Source Technology Centre
http://oss.intel.com/
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Andrew Morton on
On Thu, 11 Mar 2010 09:42:09 +0100
Florian Fainelli <florian(a)openwrt.org> wrote:

> +static struct pci_device_id rdc321x_sb_table[] = {
> + { PCI_DEVICE(PCI_VENDOR_ID_RDC, PCI_DEVICE_ID_RDC_R6030) },
> + {}
> +};

should be const, methinks.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Stephen Rothwell on
Hi Florian,

On Fri, 19 Mar 2010 13:52:09 -0700 Andrew Morton <akpm(a)linux-foundation.org> wrote:
>
> On Thu, 11 Mar 2010 09:42:09 +0100
> Florian Fainelli <florian(a)openwrt.org> wrote:
>
> > +static struct pci_device_id rdc321x_sb_table[] = {
> > + { PCI_DEVICE(PCI_VENDOR_ID_RDC, PCI_DEVICE_ID_RDC_R6030) },
> > + {}
> > +};
>
> should be const, methinks.

In fact maybe even

static DEFINE_PCI_DEVICE_TABLE(rdc321x_sb_table) = {
...

--
Cheers,
Stephen Rothwell sfr(a)canb.auug.org.au
http://www.canb.auug.org.au/~sfr/