On Mon, Jan 21, 2013 at 11:08:43AM +0530, Sekhar Nori wrote:
> > +   if (IS_ERR_OR_NULL(r)) {
> > +           dev_err(dev, "platform_get_resource() error: %ld\n",
> > +                   PTR_ERR(r));
> > +
> > +           return PTR_ERR(r);

Sigh.  Bug.

> > +   }
> > +   host1cfg_physaddr = (unsigned long)r->start;
> > +
> > +   irq = platform_get_irq(pdev, 0);
> > +   if (irq < 0) {
> > +           dev_err(dev, "platform_get_irq(pdev, 0) error: %d\n", irq);
> > +
> > +           return irq;
> > +   }
> > +
> > +   irq_data = irq_get_irq_data(irq);
> > +   if (IS_ERR_OR_NULL(irq_data)) {
> > +           dev_err(dev, "irq_get_irq_data(%d) error: %ld\n",
> > +                   irq, PTR_ERR(irq_data));
> > +
> > +           return PTR_ERR(irq_data);

Bug.

> > +   }
> > +   ack_fxn = irq_data->chip->irq_ack;
> > +
> > +   ret = request_threaded_irq(irq, davinci_rproc_callback, handle_event,
> > +           0, "davinci-remoteproc", drproc);
> > +   if (ret) {
> > +           dev_err(dev, "request_threaded_irq error: %d\n", ret);
> > +
> > +           return ret;
> > +   }
> > +
> > +   syscfg0_base = ioremap(host1cfg_physaddr & PAGE_MASK, SZ_4K);
> > +   host1cfg_offset = offset_in_page(host1cfg_physaddr);
> > +   writel(rproc->bootaddr, syscfg0_base + host1cfg_offset);
> > +
> > +   dsp_clk = clk_get(dev, NULL);
> 
> devm_clk_get() here.
> 
> > +   if (IS_ERR_OR_NULL(dsp_clk)) {
> > +           dev_err(dev, "clk_get error: %ld\n", PTR_ERR(dsp_clk));
> > +           ret = PTR_ERR(dsp_clk);

Bug.

See, yet again... almost every use of IS_ERR_OR_NULL() is a bug.
_______________________________________________
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source

Reply via email to