lkml.org 
[lkml]   [2013]   [Jan]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH 03/10] goldfish: tty driver
    Hi,

    On Wed, Jan 16, 2013 at 04:59:03PM +0000, Alan Cox wrote:
    > +static int goldfish_tty_probe(struct platform_device *pdev)
    > +{
    > + struct goldfish_tty *qtty;
    > + int ret = -EINVAL;
    > + int i;
    > + struct resource *r;
    > + struct device *ttydev;
    > + void __iomem *base;
    > + u32 irq;
    > +
    > + r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
    > + if(r == NULL)
    > + return -EINVAL;
    > +
    > + base = ioremap(r->start, 0x1000);

    missing request_mem_region(), in fact you could just use
    devm_request_and_ioremap().

    > + if (base == NULL)
    > + pr_err("goldfish_tty: unable to remap base\n");
    > +
    > + r = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
    > + if(r == NULL)
    > + goto err_unmap;
    > +
    > + irq = r->start;
    > +
    > + if(pdev->id >= goldfish_tty_line_count)
    > + goto err_unmap;
    > +
    > + mutex_lock(&goldfish_tty_lock);
    > + if(goldfish_tty_current_line_count == 0) {
    > + ret = goldfish_tty_create_driver();
    > + if(ret)
    > + goto err_create_driver_failed;
    > + }
    > + goldfish_tty_current_line_count++;
    > +
    > + qtty = &goldfish_ttys[pdev->id];
    > + spin_lock_init(&qtty->lock);
    > + tty_port_init(&qtty->port);
    > + qtty->port.ops = &goldfish_port_ops;
    > + qtty->base = base;
    > + qtty->irq = irq;
    > +
    > + writel(GOLDFISH_TTY_CMD_INT_DISABLE, base + GOLDFISH_TTY_CMD);
    > +
    > + ret = request_irq(irq, goldfish_tty_interrupt, IRQF_SHARED, "goldfish_tty", pdev);

    this is way over 80-chars, also could use some devm_request_irq().

    > + ttydev = tty_port_register_device(&qtty->port, goldfish_tty_driver, pdev->id, &pdev->dev);

    over 80-chars.

    > +MODULE_LICENSE("GPL");

    the comment header in this file says it's GPL v2, so this should be:

    MODULE_LICENSE("GPL v2");

    --
    balbi
    [unhandled content-type:application/pgp-signature]
    \
     
     \ /
      Last update: 2013-01-16 18:44    [W:3.385 / U:0.672 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site