linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Peter Meerwald <pmeerw@pmeerw.net>
Cc: linux-iio@vger.kernel.org, Shubhrajyoti Datta <shubhrajyoti@ti.com>
Subject: Re: [PATCH 1/9] staging:iio:hmc5843: Drop I2C detection code
Date: Sun, 04 Aug 2013 11:01:27 +0100	[thread overview]
Message-ID: <51FE2677.2060808@kernel.org> (raw)
In-Reply-To: <1374939112-18237-2-git-send-email-pmeerw@pmeerw.net>

On 07/27/13 16:31, Peter Meerwald wrote:
> I2C is generally not probed for devices
I wondered about this one for a while, as in some circumstances it is pretty
much the only option (hwmon drivers on random super i/o modules etc).

I'm a little worried someone might actually be using this functionality.
As the class is not specified, according to the i2c docs detection will only
function if the module is forced to load.  Also the function here does not,
as the docs specify it must, fill in the name field of the i2c_board_info structure.

Thus I'm going to drop it and see if anyone shouts about putting it back.

Chances are no one is using this and it is a legacy from this driver being
based on something in hwmon.

Jonathan
> 
> Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
> Cc: Shubhrajyoti Datta <shubhrajyoti@ti.com>
> ---
>  drivers/staging/iio/magnetometer/hmc5843.c | 33 ------------------------------
>  1 file changed, 33 deletions(-)
> 
> diff --git a/drivers/staging/iio/magnetometer/hmc5843.c b/drivers/staging/iio/magnetometer/hmc5843.c
> index 86c6bf9..e5999d4 100644
> --- a/drivers/staging/iio/magnetometer/hmc5843.c
> +++ b/drivers/staging/iio/magnetometer/hmc5843.c
> @@ -53,14 +53,6 @@ enum hmc5843_ids {
>  };
>  
>  /*
> - * Beware: identification of the HMC5883 is still "H43";
> - * I2C address is also unchanged
> - */
> -#define HMC5843_ID_REG_LENGTH			0x03
> -#define HMC5843_ID_STRING			"H43"
> -#define HMC5843_I2C_ADDRESS			0x1E
> -
> -/*
>   * Range gain settings in (+-)Ga
>   * Beware: HMC5843 and HMC5883 have different recommended sensor field
>   * ranges; default corresponds to +-1.0 Ga and +-1.3 Ga, respectively
> @@ -185,10 +177,6 @@ static const char * const hmc5883_regval_to_sample_freq[] = {
>  	"0.75", "1.5", "3", "7.5", "15", "30", "75",
>  };
>  
> -/* Addresses to scan: 0x1E */
> -static const unsigned short normal_i2c[] = { HMC5843_I2C_ADDRESS,
> -					     I2C_CLIENT_END };
> -
>  /* Describe chip variants */
>  struct hmc5843_chip_info {
>  	const struct iio_chan_spec *channels;
> @@ -621,25 +609,6 @@ static const struct hmc5843_chip_info hmc5843_chip_info_tbl[] = {
>  	},
>  };
>  
> -static int hmc5843_detect(struct i2c_client *client,
> -			  struct i2c_board_info *info)
> -{
> -	unsigned char id_str[HMC5843_ID_REG_LENGTH];
> -
> -	if (client->addr != HMC5843_I2C_ADDRESS)
> -		return -ENODEV;
> -
> -	if (i2c_smbus_read_i2c_block_data(client, HMC5843_ID_REG_A,
> -				HMC5843_ID_REG_LENGTH, id_str)
> -			!= HMC5843_ID_REG_LENGTH)
> -		return -ENODEV;
> -
> -	if (0 != strncmp(id_str, HMC5843_ID_STRING, HMC5843_ID_REG_LENGTH))
> -		return -ENODEV;
> -
> -	return 0;
> -}
> -
>  /* Called when we have found a new HMC58X3 */
>  static void hmc5843_init_client(struct i2c_client *client,
>  				const struct i2c_device_id *id)
> @@ -756,8 +725,6 @@ static struct i2c_driver hmc5843_driver = {
>  	.id_table	= hmc5843_id,
>  	.probe		= hmc5843_probe,
>  	.remove		= hmc5843_remove,
> -	.detect		= hmc5843_detect,
> -	.address_list	= normal_i2c,
>  };
>  module_i2c_driver(hmc5843_driver);
>  
> 

  reply	other threads:[~2013-08-04  9:01 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-27 15:31 Peter Meerwald
2013-07-27 15:31 ` [PATCH 1/9] staging:iio:hmc5843: Drop I2C detection code Peter Meerwald
2013-08-04 10:01   ` Jonathan Cameron [this message]
2013-07-27 15:31 ` [PATCH 2/9] staging:iio:hmc5843: Remove id register #defines, not used anymore Peter Meerwald
2013-08-04 10:02   ` Jonathan Cameron
2013-07-27 15:31 ` [PATCH 3/9] staging:iio:hmc5843: Implement timeout in read function Peter Meerwald
2013-08-04 10:03   ` Jonathan Cameron
2013-07-27 15:31 ` [PATCH 4/9] staging:iio:hmc5843: 'add' is a poor abbreviation for address Peter Meerwald
2013-08-04 10:04   ` Jonathan Cameron
2013-07-27 15:31 ` [PATCH 5/9] staging:iio:hmc5843: Device has 3 channels, no need to store separately Peter Meerwald
2013-08-04 10:10   ` Jonathan Cameron
2013-07-27 15:31 ` [PATCH 6/9] staging:iio:hmc5843: Trim sampling_frequencies to sampling_freq Peter Meerwald
2013-07-27 18:01   ` Jonathan Cameron
2013-08-04 10:13   ` Jonathan Cameron
2013-07-27 15:31 ` [PATCH 7/9] staging:iio:hmc5843: Split and join lines to make checkpatch happy Peter Meerwald
2013-08-04 10:15   ` Jonathan Cameron
2013-07-27 15:31 ` [PATCH 8/9] staging:iio:hmc5843: Drop unneeded #includes Peter Meerwald
2013-08-04 10:22   ` Jonathan Cameron
2013-07-27 15:31 ` [PATCH 9/9] staging:iio:hmc5843: Use i2c_smbus_read_word_swapped() Peter Meerwald
2013-08-04 10:23   ` Jonathan Cameron

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=51FE2677.2060808@kernel.org \
    --to=jic23@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=pmeerw@pmeerw.net \
    --cc=shubhrajyoti@ti.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).