mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Trilok Soni" <soni.trilok@gmail.com>
To: me@felipebalbi.com
Cc: samuel@sortiz.org, linux-kernel@vger.kernel.org,
	irda-users@lists.sourceforge.net,
	"Andrew Morton" <akpm@linux-foundation.org>,
	linux-omap@vger.kernel.org
Subject: Re: [irda-users] [PATCH] OMAP IrDA driver
Date: Mon, 22 Dec 2008 16:54:19 +0530	[thread overview]
Message-ID: <5d5443650812220324m476614bfu3936e1c2cd682660@mail.gmail.com> (raw)
In-Reply-To: <20081205215344.GJ18379@frodo>

Hi Felipe,

Sorry for delayed reply.

>> +
>> +     void *rx_buf_dma_virt;          /* Virtual address of RX DMA buffer */
>> +     void *tx_buf_dma_virt;          /* Virtual address of TX DMA buffer */
>
> should these two be void __iomem * ?

Agreed.

>
>> +
>> +     struct device *dev;
>> +     struct omap_irda_config *pdata;
>> +};
>> +
>> +static inline void uart_reg_out(int idx, u8 val)
>> +{
>> +     omap_writeb(val, idx);
>
> __raw_writeb(), pass a reference to struct omap_irda here so you'd have
> access to a void __iomem *base (read below).

Agreed.

>> + */
>> +static void omap_irda_rx_dma_callback(int lch, u16 ch_status, void *data)
>> +{
>> +     struct net_device *dev = data;
>> +     struct omap_irda *omap_ir = netdev_priv(dev);
>> +
>> +     printk(KERN_ERR "RX Transfer error or very big frame\n");
>
> you have a device pointer in omap_ir, use it and convert these to
> dev_dbg() calls.

Agree.


>
>> +     if (omap_ir->pdata->transceiver_mode && machine_is_omap_h2()) {
>> +             /* Is it select_irda on H2 ? */
>> +             omap_writel(omap_readl(FUNC_MUX_CTRL_A) | 7,
>> +                                     FUNC_MUX_CTRL_A);
>
> __raw_writel/__raw_readl.

Agree.

>
>> +static int omap_irda_probe(struct platform_device *pdev)
>> +{
>> +     struct net_device *dev;
>> +     struct omap_irda *omap_ir;
>> +     struct omap_irda_config *pdata = pdev->dev.platform_data;
>> +     unsigned int baudrate_mask;
>> +     int err = 0;
>> +     int irq = NO_IRQ;
>
> you should probably have a struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>
> and use it to ioremap() the base address. Then you can stop using the
> omap_read[bsl]/omap_write[bsl] calls and switch over to standard
> __raw_read[bsl]/__raw_write[bsl] ones.
>

Right.

>> +
>> +     dev = alloc_irdadev(sizeof(struct omap_irda));
>> +     if (!dev)
>> +             goto err_mem_1;
>> +
>> +
>
> one blank line only.
>

Ok.

>> +
>> +     /* Any better way to avoid this? No. */
>> +     if (machine_is_omap_h3() || machine_is_omap_h4())
>> +             INIT_DELAYED_WORK(&omap_ir->pdata->gpio_expa, NULL);
>
> what does this mean ? what's that gpio_expa??

gpio_expa name here is misleading now. It is work name being scheduled
of sleeping gpio/i2c operations over pcf857x expander chip. No harm
otherwise.

>> +
>> +static int omap_irda_remove(struct platform_device *pdev)
>> +{
>> +     struct net_device *dev = platform_get_drvdata(pdev);
>> +
>> +     if (pdev) {
>> +             unregister_netdev(dev);
>> +             free_netdev(dev);
>> +     }
>
> pdev is always true here, remove this if().

Ok.

>> +
>> +static char __initdata banner[] = KERN_INFO "OMAP IrDA driver initializing\n";
>> +
>> +static int __init omap_irda_init(void)
>> +{
>> +     printk(banner);
>
> you can remove this banner. No need for it.

Ok.



-- 
---Trilok Soni
http://triloksoni.wordpress.com
http://www.linkedin.com/in/triloksoni

      reply	other threads:[~2008-12-22 11:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-05  6:34 Trilok Soni
2008-12-05  9:28 ` [irda-users] " samuel
2008-12-05  9:48   ` Trilok Soni
2008-12-05 20:32     ` Tony Lindgren
2008-12-22 11:20       ` Trilok Soni
2008-12-05 21:53     ` Felipe Balbi
2008-12-22 11:24       ` Trilok Soni [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=5d5443650812220324m476614bfu3936e1c2cd682660@mail.gmail.com \
    --to=soni.trilok@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=irda-users@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=me@felipebalbi.com \
    --cc=samuel@sortiz.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

all inboxes | Powered by JetHome®