linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonas Bonn <jonas-A9uVI2HLR7kOP4wsBPIw7w@public.gmane.org>
To: Wolfram Sang <w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH 1/2] i2c-ocores: Adapt for device tree
Date: Wed, 24 Nov 2010 16:32:50 +0100	[thread overview]
Message-ID: <1290612770.2959.21.camel@needafix> (raw)
In-Reply-To: <20101124145843.GD6812-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>

On Wed, 2010-11-24 at 15:58 +0100, Wolfram Sang wrote:
> Hi,
> 
> quick review (hopefully not too quick)...
> 

Thanks... see my comments below.

> > +	val = (int*) of_get_property(pdev->dev.of_node, "regstep", NULL);
> > +	if (!val) {
> > +		dev_err(&pdev->dev, "Missing required paramter 'regstep'");
> > +		return -ENODEV;
> > +	}
> 
> New properties need to be documented (e.g. like here¹). What is regstep?
> 
> ¹ http://lists.ozlabs.org/pipermail/devicetree-discuss/2010-November/003569.html
> 

While I agree that these parameters need documentation, I haven't seen
that there is an agreed upon place to put such documentation as of yet.
I followed your link but didn't find the corresponding document in the
kernel tree.  Should I really be putting my documentation in the
Documentation/powerpc directory?

> >  	i2c->adap = ocores_adapter;
> >  	i2c_set_adapdata(&i2c->adap, i2c);
> >  	i2c->adap.dev.parent = &pdev->dev;
> > +#ifdef CONFIG_OF
> > +	i2c->adap.dev.of_node = pdev->dev.of_node;
> > +#endif
> 
> No need for the ifdef here.
> 

Why?  of_node is protected by CONFIG_OF in linux/device.h

> >  
> > +#ifdef CONFIG_OF
> > +static struct of_device_id ocores_i2c_match[] = {
> > +        {
> > +                .compatible = "opencores,i2c-ocores",
> > +        },
> > +        {},
> > +};
> > +MODULE_DEVICE_TABLE(of, ocores_i2c_match);
> > +#endif
> 
> ditto

Dropping the ifdef begets a build warning...

> >  		.name = "ocores-i2c",
> > +#ifdef CONFIG_OF
> > +                .of_match_table = ocores_i2c_match,
> > +#endif
> 
> ditto

Same here, of_match_table is protected by CONFIG_OF.  How is this ifdef
not necessary?

Thanks again for the review.
Cheers,
Jonas

_______________________________________________
devicetree-discuss mailing list
devicetree-discuss@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/devicetree-discuss

  parent reply	other threads:[~2010-11-24 15:32 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-24 14:09 i2c-ocores changes Jonas Bonn
     [not found] ` <1290607789-8996-1-git-send-email-jonas-A9uVI2HLR7kOP4wsBPIw7w@public.gmane.org>
2010-11-24 14:09   ` [PATCH 1/2] i2c-ocores: Adapt for device tree Jonas Bonn
     [not found]     ` <1290607789-8996-2-git-send-email-jonas-A9uVI2HLR7kOP4wsBPIw7w@public.gmane.org>
2010-11-24 14:58       ` Wolfram Sang
     [not found]         ` <20101124145843.GD6812-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2010-11-24 15:32           ` Jonas Bonn [this message]
2010-11-24 15:42             ` Wolfram Sang
2010-11-24 15:22       ` Grant Likely
2010-11-24 14:09   ` [PATCH 2/2] i2c-ocores: Use devres for resource allocation Jonas Bonn

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=1290612770.2959.21.camel@needafix \
    --to=jonas-a9uvi2hlr7kop4wsbpiw7w@public.gmane.org \
    --cc=devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
    --cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.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 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).