linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Greg KH <gregkh@suse.de>
To: Wolfram Sang <w.sang@pengutronix.de>
Cc: linuxppc-dev@ozlabs.org, hjk@linutronix.de, linux-kernel@vger.kernel.org
Subject: Re: [RESEND][PATCH] uio: Add of_platform_driver to uio_pdrv_genirq
Date: Thu, 11 Dec 2008 12:50:33 -0800	[thread overview]
Message-ID: <20081211205033.GA7080@suse.de> (raw)
In-Reply-To: <1229007937-5501-1-git-send-email-w.sang@pengutronix.de>

On Thu, Dec 11, 2008 at 04:05:37PM +0100, Wolfram Sang wrote:
> Make the generic uio-driver also accessible for of devices. It utilizes the
> standard 'reg' and 'interrupt' properties. A typical usage would look like
> this:
> 
> 	fpga-io@00003000 {
> 		compatible = "generic-uio";
> 		reg = <0x00003000 0x20>;
> 		interrupts = <0xa>;
> 		interrupt-parent = <&fpga_irq_mux>;
> 	};
> 
> To achieve this, the probe function has been refactored, so it can be used by
> platform and of code. Then, the of driver has been added.
> 
> Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
> ---
>  drivers/uio/uio_pdrv_genirq.c |  178 ++++++++++++++++++++++++++++++++++++------
>  1 file changed, 154 insertions(+), 24 deletions(-)
> 
> Index: playground/drivers/uio/uio_pdrv_genirq.c
> ===================================================================
> --- playground.orig/drivers/uio/uio_pdrv_genirq.c
> +++ playground/drivers/uio/uio_pdrv_genirq.c
> @@ -1,13 +1,15 @@
>  /*
>   * drivers/uio/uio_pdrv_genirq.c
>   *
> - * Userspace I/O platform driver with generic IRQ handling code.
> + * Userspace I/O platform & of driver with generic IRQ handling code.
>   *
>   * Copyright (C) 2008 Magnus Damm
> + * Copyright (C) 2008 Wolfram Sang, Pengutronix e.K.
>   *
>   * Based on uio_pdrv.c by Uwe Kleine-Koenig,
>   * Copyright (C) 2008 by Digi International Inc.
>   * All rights reserved.
> + * Adding of_platform_driver based on xilinxfb.c by Grant Likely.
>   *
>   * This program is free software; you can redistribute it and/or modify it
>   * under the terms of the GNU General Public License version 2 as published by
> @@ -20,6 +22,10 @@
>  #include <linux/bitops.h>
>  #include <linux/interrupt.h>
>  #include <linux/stringify.h>
> +#if defined(CONFIG_OF)
> +#include <linux/of_device.h>
> +#include <linux/of_platform.h>
> +#endif

You should never need to test a config variable in order to know to
include a header file or not.

> +/* ---------------------------------------------------------------------
> + * OF bus binding
> + */
> +
> +#if defined(CONFIG_OF)

Same goes here, don't put #if in .c files please.

thanks,

greg k-h

  reply	other threads:[~2008-12-11 20:54 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-11 15:05 [RESEND][PATCH] uio: Add of_platform_driver to uio_pdrv_genirq Wolfram Sang
2008-12-11 20:50 ` Greg KH [this message]
2008-12-16 12:27   ` adding of_platform_drivers (was: Re: [RESEND][PATCH] uio: Add of_platform_driver to uio_pdrv_genirq) Wolfram Sang
2008-12-16 17:16     ` Greg KH
2008-12-16 12:25 ` [RESEND][PATCH] uio: Add of_platform_driver to uio_pdrv_genirq Paul Mundt
2008-12-16 12:41   ` Wolfram Sang
2008-12-16 13:18     ` Paul Mundt
2008-12-19 13:41     ` Magnus Damm

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=20081211205033.GA7080@suse.de \
    --to=gregkh@suse.de \
    --cc=hjk@linutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=w.sang@pengutronix.de \
    /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).