lkml.org 
[lkml]   [2012]   [Jun]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3] clock: max77686: Add driver for Maxim 77686 32KHz crystal oscillator
On Mon, Jun 11, 2012 at 02:09:59PM +0300, Felipe Balbi wrote:
> On Mon, Jun 11, 2012 at 08:01:20PM +0900, Jonghwa Lee wrote:

> > +static __devinit int max77686_clk_probe(struct platform_device *pdev)

> why platform_device ? Isn't this an i2c device ? So this should be
> i2c-client driver...

It's a component on an MFD.

> > + if (!max77686[i])
> > + return -ENOMEM;
> > +
> > + max77686[i]->iodev = iodev;
> > + max77686[i]->mask = 1 << i;
> > + mutex_init(&max77686[i]->mutex);
> > + }

> doesn't look like the right way to do this. What if a user doesn't use
> all clk outputs ?

It seems like a bad idea for the individual drivers to have to worry
about that, it seems simpler for them to register all their resources
and then let the subsystem do what it likes with them.

> > +static int __devexit max77686_clk_remove(struct platform_device *pdev)
> > +{
> > + kfree(clk32khz_ap);
> > + kfree(clk32khz_cp);
> > + kfree(clk32khz_pmic);

> kfree() or clk_unregister() ??

Shouldn't be kfree(), the memory is allocated with devm_kzalloc().
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2012-06-11 15:22    [W:0.129 / U:0.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site