Re: [PATCH v7 2/5] irqchip/irq-goldfish-pic: Add Goldfish PIC driver

From: Joe Perches
Date: Thu Nov 02 2017 - 12:34:53 EST


On Thu, 2017-11-02 at 17:21 +0100, Aleksandar Markovic wrote:
> From: Miodrag Dinic <miodrag.dinic@xxxxxxxx>
>
> Add device driver for a virtual programmable interrupt controller
>
> The virtual PIC is designed as a device tree-based interrupt controller.
>
> The compatible string used by OS for binding the driver is
> "google,goldfish-pic".
>
> Signed-off-by: Miodrag Dinic <miodrag.dinic@xxxxxxxx>
> Signed-off-by: Goran Ferenc <goran.ferenc@xxxxxxxx>
> Signed-off-by: Aleksandar Markovic <aleksandar.markovic@xxxxxxxx>
> wq

vi much?

> diff --git a/drivers/irqchip/irq-goldfish-pic.c b/drivers/irqchip/irq-goldfish-pic.c
[]
> @@ -0,0 +1,134 @@
> +/*
> + * Driver for MIPS Goldfish Programmable Interrupt Controller.
> + *
> + * Author: Miodrag Dinic <miodrag.dinic@xxxxxxxx>
> + *
> + * This program is free software; you can redistribute it and/or modify it
> + * under the terms of the GNU General Public License as published by the
> + * Free Software Foundation; either version 2 of the License, or (at your
> + * option) any later version.
> + */

Odd mix of spaces and tabs

It'd be good to add a #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
before any #include so the pr_<level> output is prefixed appropriately.

> +#include <linux/interrupt.h>
> +#include <linux/irq.h>
> +#include <linux/irqchip.h>
> +#include <linux/irqchip/chained_irq.h>
> +#include <linux/irqdomain.h>
> +#include <linux/of_address.h>
> +#include <linux/of_irq.h>
[]
> +static int __init goldfish_pic_of_init(struct device_node *of_node,
> + struct device_node *parent)
> +{
[]
> + parent_irq = irq_of_parse_and_map(of_node, 0);
> + if (!parent_irq) {
> + pr_err("Failed to map Goldfish PIC parent IRQ!\n");

So these could become

pr_err("Failed to map parent IRQ\n");

> + ret = -EINVAL;
> + goto out_free;
> + }
> +
> + gfpic->base = of_iomap(of_node, 0);
> + if (!gfpic->base) {
> + pr_err("Failed to map Goldfish PIC base!\n");

pr_err("Failed to map base\n");

etc...