linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Grant Likely <grant.likely@secretlab.ca>
To: Sean MacLennan <smaclennan@pikatech.com>
Cc: linuxppc-dev <linuxppc-dev@ozlabs.org>
Subject: Re: Cleanup for i2c driver changes.
Date: Sat, 26 Jul 2008 14:28:19 -0400	[thread overview]
Message-ID: <20080726182819.GA11285@secretlab.ca> (raw)
In-Reply-To: <20080725214510.400c6ce8@lappy.seanm.ca>

On Fri, Jul 25, 2008 at 09:45:10PM -0400, Sean MacLennan wrote:
> This patch removes the i2c code which is now obsolete due to the new
> ibm iic driver walking the device tree for child nodes.
> 
> There are two other small cleanups that came indirectly from the ad7414
> code review. Make sure Tlow is correct and handle the case where
> i2c_smbus_read_word_data fails.
> 
> Signed-off-by: Sean MacLennan <smaclennan@pikatech.com>

Looks okay to me, but you should really cc: the 4xx maintainer (Josh
Boyer) when sending out 4xx patches.

Cheers,
g.

> ---
> diff --git a/arch/powerpc/platforms/44x/warp.c b/arch/powerpc/platforms/44x/warp.c
> index 9565995..960edf8 100644
> --- a/arch/powerpc/platforms/44x/warp.c
> +++ b/arch/powerpc/platforms/44x/warp.c
> @@ -30,18 +30,6 @@ static __initdata struct of_device_id warp_of_bus[] = {
>  	{},
>  };
>  
> -static __initdata struct i2c_board_info warp_i2c_info[] = {
> -	{ I2C_BOARD_INFO("ad7414", 0x4a) }
> -};
> -
> -static int __init warp_arch_init(void)
> -{
> -	/* This should go away once support is moved to the dts. */
> -	i2c_register_board_info(0, warp_i2c_info, ARRAY_SIZE(warp_i2c_info));
> -	return 0;
> -}
> -machine_arch_initcall(warp, warp_arch_init);
> -
>  static int __init warp_device_probe(void)
>  {
>  	of_platform_bus_probe(NULL, warp_of_bus, NULL);
> @@ -223,7 +211,7 @@ static void pika_setup_critical_temp(struct i2c_client *client)
>  
>  	/* These registers are in 1 degree increments. */
>  	i2c_smbus_write_byte_data(client, 2, 65); /* Thigh */
> -	i2c_smbus_write_byte_data(client, 3, 55); /* Tlow */
> +	i2c_smbus_write_byte_data(client, 3,  0); /* Tlow */
>  
>  	np = of_find_compatible_node(NULL, NULL, "adi,ad7414");
>  	if (np == NULL) {
> @@ -289,8 +277,15 @@ found_it:
>  	printk(KERN_INFO "PIKA DTM thread running.\n");
>  
>  	while (!kthread_should_stop()) {
> -		u16 temp = swab16(i2c_smbus_read_word_data(client, 0));
> -		out_be32(fpga + 0x20, temp);
> +		int val;
> +
> +		val = i2c_smbus_read_word_data(client, 0);
> +		if (val < 0)
> +			dev_dbg(&client->dev, "DTM read temp failed.\n");
> +		else {
> +			s16 temp = swab16(val);
> +			out_be32(fpga + 0x20, temp);
> +		}
>  
>  		pika_dtm_check_fan(fpga);
>  
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev

      reply	other threads:[~2008-07-26 18:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-26  1:45 Cleanup for i2c driver changes Sean MacLennan
2008-07-26 18:28 ` Grant Likely [this message]

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=20080726182819.GA11285@secretlab.ca \
    --to=grant.likely@secretlab.ca \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=smaclennan@pikatech.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;
as well as URLs for NNTP newsgroup(s).