From: Christoph Hellwig <hch@infradead.org>
To: Greg KH <greg@kroah.com>
Cc: linux-kernel@vger.kernel.org, sensors@stimpy.netroedge.com
Subject: Re: [PATCH] i2c driver changes for 2.5.64
Date: Fri, 14 Mar 2003 08:19:04 +0000 [thread overview]
Message-ID: <20030314081904.A11701@infradead.org> (raw)
In-Reply-To: <10476033153504@kroah.com>; from greg@kroah.com on Thu, Mar 13, 2003 at 04:55:00PM -0800
On Thu, Mar 13, 2003 at 04:55:00PM -0800, Greg KH wrote:
> +/* Detect whether a ALI15X3 can be found, and initialize it, where necessary.
> + Note the differences between kernels with the old PCI BIOS interface and
> + newer kernels with the real PCI interface. In compat.h some things are
> + defined to make the transition easier. */
This comment seems a bit outdated..
> +int ali15x3_setup(void)
Should be static like everything in this file (and merged into
ali15x3_probe anyway).
> +{
> + u16 a;
> + unsigned char temp;
> +
> + struct pci_dev *ALI15X3_dev;
> +
> + /* First check whether we can access PCI at all */
> + if (pci_present() == 0) {
> + printk("i2c-ali15x3.o: Error: No PCI-bus found!\n");
> + return -ENODEV;
> + }
You're calling this from pci_driver->probe, so you will never get
here without PCI hardware.
> + /* Look for the ALI15X3, M7101 device */
> + ALI15X3_dev = NULL;
> + ALI15X3_dev = pci_find_device(PCI_VENDOR_ID_AL,
> + PCI_DEVICE_ID_AL_M7101, ALI15X3_dev);
> + if (ALI15X3_dev == NULL) {
> + printk("i2c-ali15x3.o: Error: Can't detect ali15x3!\n");
> + return -ENODEV;
> + }
Calling pci_find_device in ->probe looks buggy to me. What are you
trying to do?
> +/* Is SMB Host controller enabled? */
> + pci_read_config_byte(ALI15X3_dev, SMBHSTCFG, &temp);
> + if ((temp & 1) == 0) {
What about proper indentation for the comments?
> +/* Internally used pause function */
> +void ali15x3_do_pause(unsigned int amount)
> +{
> + current->state = TASK_INTERRUPTIBLE;
> + schedule_timeout(amount);
> +}
I think this should be moved to linux/kernel.h as delay() - I've seen
it duplicated in so much code (including XFS)
> +#ifdef DEBUG
> + printk
> + ("i2c-ali15x3.o: Transaction (pre): STS=%02x, CNT=%02x, CMD=%02x, ADD=%02x, DAT0=%02x, "
> + "DAT1=%02x\n", inb_p(SMBHSTSTS), inb_p(SMBHSTCNT),
> + inb_p(SMBHSTCMD), inb_p(SMBHSTADD), inb_p(SMBHSTDAT0),
> + inb_p(SMBHSTDAT1));
> +#endif
use pr_debug() here.
> +static struct pci_device_id ali15x3_ids[] __devinitdata = {
> + { 0, }
> +};
Umm?
next prev parent reply other threads:[~2003-03-14 8:08 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-03-14 0:50 [BK PATCH] i2c driver changes for 2.5.64 Greg KH
2003-03-14 0:55 ` [PATCH] " Greg KH
2003-03-14 0:55 ` Greg KH
2003-03-14 0:55 ` Greg KH
2003-03-14 0:55 ` Greg KH
2003-03-14 0:55 ` Greg KH
2003-03-14 0:55 ` Greg KH
2003-03-14 0:55 ` Greg KH
2003-03-14 0:55 ` Greg KH
2003-03-14 0:55 ` Greg KH
2003-03-14 0:55 ` Greg KH
2003-03-15 9:49 ` Vojtech Pavlik
2003-03-15 21:46 ` Greg KH
2003-03-15 22:06 ` Vojtech Pavlik
2003-03-14 8:28 ` Christoph Hellwig
2003-03-14 8:21 ` Christoph Hellwig
2003-03-14 8:53 ` Greg KH
2003-03-14 8:19 ` Christoph Hellwig [this message]
2003-03-14 8:56 ` Greg KH
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=20030314081904.A11701@infradead.org \
--to=hch@infradead.org \
--cc=greg@kroah.com \
--cc=linux-kernel@vger.kernel.org \
--cc=sensors@stimpy.netroedge.com \
/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