linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Anton Vorontsov <avorontsov-hkdhdckH98+B+jHODAdFcQ@public.gmane.org>
To: Wolfram Sang <w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	David Brownell
	<dbrownell-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>,
	Juergen Beisert
	<j.beisert-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>,
	Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>,
	spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org,
	Andrew Morton
	<akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>
Subject: Re: [spi-devel-general] [PATCH] gpio: add driver for MAX7300 I2C GPIO extender
Date: Thu, 19 Nov 2009 02:10:52 +0300	[thread overview]
Message-ID: <20091118231052.GA23699@oksana.dev.rtsoft.ru> (raw)
In-Reply-To: <1258546646-11586-1-git-send-email-w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>

On Wed, Nov 18, 2009 at 01:17:26PM +0100, Wolfram Sang wrote:
> Add the MAX7300-I2C variant to the MAX7301-SPI version. They share most parts
> of the driver (i.e. the logic) and the read/write-register functions get
> encapsulated. It is thus possible to use both variants simultaneously.
> 
> diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig
> index 2ad0128..a1d2608 100644
[...]
> +MODULE_ALIAS("spi:max7301");
> +
> +#define max7301_add_driver(drv) spi_register_driver(drv)
> +#define max7301_del_driver(drv) spi_unregister_driver(drv)
> +#else
> +#define max7301_add_driver(drv) (0)
> +#define max7301_del_driver(drv) do { } while(0)
> +#endif /* CONFIG_GPIO_MAX7301_SPI */
[...]
>  static int __init max7301_init(void)
>  {
> -	return spi_register_driver(&max7301_driver);
> +	int ret;
> +	ret = max7300_add_driver(&max7300_driver);
> +	if (ret)
> +		return ret;
> +	ret = max7301_add_driver(&max7301_driver);

Nowadays you can use device table matching, as an example see
commit 8cec03eee4a771f949c70cff07775c9bb21d4642 ("hwmon: lm70:
convert to device table matching").

Thanks,

-- 
Anton Vorontsov
email: cbouatmailru-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
irc://irc.freenode.net/bd2

  parent reply	other threads:[~2009-11-18 23:10 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-18 12:17 [PATCH] gpio: add driver for MAX7300 I2C GPIO extender Wolfram Sang
     [not found] ` <1258546646-11586-1-git-send-email-w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2009-11-18 23:10   ` Anton Vorontsov [this message]
     [not found]     ` <20091118231052.GA23699-wnGakbxT3iijyJ0x5qLZdcN33GVbZNy3@public.gmane.org>
2009-11-19 14:02       ` [PATCH V2] " Wolfram Sang
     [not found]         ` <1258639349-5457-1-git-send-email-w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2009-11-19 15:06           ` Anton Vorontsov
     [not found]             ` <20091119150626.GA6057-wnGakbxT3iijyJ0x5qLZdcN33GVbZNy3@public.gmane.org>
2009-11-20 10:56               ` [PATCH V3] " Wolfram Sang

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=20091118231052.GA23699@oksana.dev.rtsoft.ru \
    --to=avorontsov-hkdhdckh98+b+jhodadfcq@public.gmane.org \
    --cc=akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org \
    --cc=dbrownell-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    --cc=j.beisert-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org \
    --cc=khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org \
    --cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    --cc=w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.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;
as well as URLs for NNTP newsgroup(s).