[PATCH] Add LM93 support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Am Dienstag 01 Mai 2007 05:30 schrieb Mark M. Hoffman:
> Hi Hans:
> 
> > Am Montag 30 April 2007 06:07 schrieb Mark M. Hoffman:
> > > First: would you like to add an entry to MAINTAINERS for this driver, pointing
> > > to yourself?  Although I wrote the original, I no longer have access to the
> > > hardware.
> 
> * Hans-J?rgen Koch <hjk at linutronix.de> [2007-04-30 11:56:34 +0200]:
> > I have a similar problem. The hardware I'm testing with now is not my property,
> > I'll have to give it back one day. I'm thinking about building a i2c_parport
> > adapter where I can attach sensors chips. Dunno yet if this is feasible. If
> > I have a LM93 available permanently, I have no problems with becoming its
> > driver's maintainer. But I don't want to add myself to MAINTAINERS before that
> > is the case.
> 
> It's not too difficult to build one of those.  

I used to be a hardware developer for many years, so I think I could do that.
It's more a question of time...

> Or if you can solder fine pitch, 
> you can fly some wires off of a DIMM for SCL/SDA.  

Aaarrgh!

> Or search the i2c archives 
> for a USB->I2C device designed by Till Harbaum (sp?).

Sounds interesting, I'll have a look.

> 
> Anyway, it's up to you if you want to patch yourself into MAINTAINERS or not.

I'm in MAINTAINERS for the MAX6650 driver already. I think I should only be
listed there for drivers where I actually got the device ready for tests.
As soon as I call a LM93 my own, I'll send a patch and apply for being added
to MAINTAINERS.

[...] 
> 
> You missed some of my comments near the bottom of the driver source:

No, I didn't. 2nd order stupidity on my side. Too tired to handle tools 
correctly. Sorry for the inconvenience.


> 
> > +	err = PTR_ERR(data->class_dev);
> > +	dev_err(&client->dev, "error registering hwmon device.\n");
> > +	sysfs_remove_group(&client->dev.kobj, &lm93_attr_grp);
> > +err_detach:
> > +	i2c_detach_client(client);
> > +err_free:
> > +	kfree(client);
> 
> kfree(data);

fixed.

> 
> > +err_out:
> > +	return err;
> > +}
> > +
> > +/* This function is called when:
> > +     * lm93_driver is inserted (when this module is loaded), for each
> > +       available adapter
> > +     * when a new adapter is inserted (and lm93_driver is still present) */
> > +static int lm93_attach_adapter(struct i2c_adapter *adapter)
> > +{
> > +	return i2c_probe(adapter, &addr_data, lm93_detect);
> > +}
> > +
> > +static int lm93_detach_client(struct i2c_client *client)
> > +{
> > +	struct lm93_data *data = i2c_get_clientdata(client);
> > +	int err = 0;
> > +
> > +	sysfs_remove_group(&client->dev.kobj, &lm93_attr_grp);
> > +	hwmon_device_unregister(data->class_dev);
> > +
> 
> The hwmon_device_unregister() should precede the sysfs_remove_group().

fixed.

> 
> > +	err = i2c_detach_client(client);
> > +	if (!err)
> > +		kfree(client);
> 
> kfree(data);

fixed.

> 
> > +	return err;
> > +}
> > +
> > +static int __init lm93_init(void)
> > +{
> > +	return i2c_add_driver(&lm93_driver);
> > +}
>

Find attached the corrected version of the patch.

Thanks,
Hans



-------------- next part --------------
A non-text attachment was scrubbed...
Name: lm93-support.patch
Type: text/x-diff
Size: 108962 bytes
Desc: not available
Url : http://lists.lm-sensors.org/pipermail/lm-sensors/attachments/20070501/c5607e57/attachment.bin 


[Index of Archives]     [Linux Kernel]     [Linux Hardware Monitoring]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux