All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jean Delvare <khali@linux-fr.org>
To: lm-sensors@vger.kernel.org
Subject: Re: [lm-sensors] PATCH: abituguru3-fix-detect.patch
Date: Sat, 31 May 2008 16:02:39 +0000	[thread overview]
Message-ID: <20080531180239.068ec2be@hyperion.delvare> (raw)
In-Reply-To: <4836D061.9080501@hhs.nl>

Hi Hans,

On Fri, 23 May 2008 16:10:41 +0200, Hans de Goede wrote:
> It has been reported that the abituguru3 driver fails to load after a BIOS
> update. This patch fixes this by loosening the detection routine so that it
> will work after the BIOS update too. To compensate for the now very loose
> detection an additional check is added on the DMI Base Board vendor string to
> make sure we only load on Abit motherboards, this is the same as the check in
> the abituguru (1 / 2) driver.
> 
> Signed-of-by: Hans de Goede <j.w.r.degoede@hhs.nl>

Missing "f".

> diff -up vanilla-2.6.26-rc3-git4/drivers/hwmon/abituguru3.c~ vanilla-2.6.26-rc3-git4/drivers/hwmon/abituguru3.c
> --- vanilla-2.6.26-rc3-git4/drivers/hwmon/abituguru3.c~	2008-05-23 16:03:28.000000000 +0200
> +++ vanilla-2.6.26-rc3-git4/drivers/hwmon/abituguru3.c	2008-05-23 16:03:28.000000000 +0200
> @@ -30,6 +30,7 @@
>  #include <linux/platform_device.h>
>  #include <linux/hwmon.h>
>  #include <linux/hwmon-sysfs.h>
> +#include <linux/dmi.h>
>  #include <asm/io.h>
>  
>  /* uGuru3 bank addresses */
> @@ -1111,11 +1112,12 @@ static int __init abituguru3_detect(void
>  {
>  	/* See if there is an uguru3 there. An idle uGuru3 will hold 0x00 or
>  	   0x08 at DATA and 0xAC at CMD. Sometimes the uGuru3 will hold 0x05
> -	   at CMD instead, why is unknown. So we test for 0x05 too. */
> +	   or 0x55 at CMD instead, why is unknown. */
>  	u8 data_val = inb_p(ABIT_UGURU3_BASE + ABIT_UGURU3_DATA);
>  	u8 cmd_val = inb_p(ABIT_UGURU3_BASE + ABIT_UGURU3_CMD);
>  	if (((data_val = 0x00) || (data_val = 0x08)) &&
> -			((cmd_val = 0xAC) || (cmd_val = 0x05)))
> +			((cmd_val = 0xAC) || (cmd_val = 0x05) ||
> +			 (cmd_val = 0x55)))
>  		return ABIT_UGURU3_BASE;
>  
>  	ABIT_UGURU3_DEBUG("no Abit uGuru3 found, data = 0x%02X, cmd = "
> @@ -1138,6 +1140,15 @@ static int __init abituguru3_init(void)
>  	int address, err;
>  	struct resource res = { .flags = IORESOURCE_IO };
>  
> +#ifdef CONFIG_DMI
> +	const char *board_vendor = dmi_get_system_info(DMI_BOARD_VENDOR);
> +
> +	/* safety check, refuse to load on non Abit motherboards */
> +	if (!force && (!board_vendor ||
> +			strcmp(board_vendor, "http://www.abit.com.tw/")))
> +		return -ENODEV;
> +#endif
> +
>  	address = abituguru3_detect();
>  	if (address < 0)
>  		return address;

Looks good to me.

Acked-by: Jean Delvare <khali@linux-fr.org>

Note though that the #ifdef is not needed as far as I can see. Without
DMI, dmi_get_system_info() will simply return NULL and your code
handles this case properly.

-- 
Jean Delvare

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

  parent reply	other threads:[~2008-05-31 16:02 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-23 14:10 [lm-sensors] PATCH: abituguru3-fix-detect.patch Hans de Goede
2008-05-26 17:05 ` Alistair John Strachan
2008-05-30 11:51 ` Jean Delvare
2008-05-31  6:26 ` Hans de Goede
2008-05-31 16:02 ` Jean Delvare [this message]
2008-06-08 15:16 ` Mark M. Hoffman
2008-07-03 20:00 ` Alistair John Strachan
2008-07-03 20:18 ` Hans de Goede
2008-07-04 11:55 ` Jean Delvare
2008-07-04 12:02 ` Hans de Goede
2008-07-04 13:07 ` Jean Delvare
2008-07-31 10:30 ` Hans de Goede
2008-07-31 16:48 ` Andrew Morton
2008-07-31 17:35 ` Hans de Goede

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=20080531180239.068ec2be@hyperion.delvare \
    --to=khali@linux-fr.org \
    --cc=lm-sensors@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.