From: Anton Vorontsov <cbouatmailru@gmail.com>
To: mkl0301@gmail.com
Cc: htejun@gmail.com, linux-arm-kernel@lists.infradead.org,
jgarzik@pobox.com, linux-ide@vger.kernel.org
Subject: Re: [PATCH v4 2/3] ahci_platform: switch to module device table matching
Date: Sun, 9 Jan 2011 05:56:18 +0300 [thread overview]
Message-ID: <20110109025618.GA27507@oksana.dev.rtsoft.ru> (raw)
In-Reply-To: <1294537775-21714-3-git-send-email-mkl0301@gmail.com>
On Sun, Jan 09, 2011 at 09:49:34AM +0800, mkl0301@gmail.com wrote:
> From: Mac Lin <mkl0301@gmail.com>
>
> Switch the driver to use module device table matching mechanism to add SoC-specific parts to the generic driver.
>
> Signed-off-by: Mac Lin <mkl0301@gmail.com>
> ---
> drivers/ata/ahci_platform.c | 14 +++++++++++++-
> drivers/ata/ahci_platforms.h | 16 ++++++++++++++++
I think header and .c file names should match. I.e. just
ahci_platform.h.
> 2 files changed, 29 insertions(+), 1 deletions(-)
> create mode 100644 drivers/ata/ahci_platforms.h
>
> diff --git a/drivers/ata/ahci_platform.c b/drivers/ata/ahci_platform.c
> index 6fef1fa..190db2c 100644
> --- a/drivers/ata/ahci_platform.c
> +++ b/drivers/ata/ahci_platform.c
> @@ -19,9 +19,11 @@
> #include <linux/interrupt.h>
> #include <linux/device.h>
> #include <linux/platform_device.h>
> +#include <linux/mod_devicetable.h>
> #include <linux/libata.h>
> #include <linux/ahci_platform.h>
> #include "ahci.h"
> +#include "ahci_platforms.h"
>
> static struct scsi_host_template ahci_platform_sht = {
> AHCI_SHT("ahci_platform"),
> @@ -29,6 +31,7 @@ static struct scsi_host_template ahci_platform_sht = {
>
> static int __init ahci_probe(struct platform_device *pdev)
> {
> + const struct platform_device_id *platid = platform_get_device_id(pdev);
> struct device *dev = &pdev->dev;
> struct ahci_platform_data *pdata = dev->platform_data;
> struct ata_port_info pi = {
> @@ -46,6 +49,9 @@ static int __init ahci_probe(struct platform_device *pdev)
> int i;
> int rc;
>
> + if (!pdata && platid && platid->driver_data)
> + pdata = (void *)platid->driver_data;
> +
> mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> if (!mem) {
> dev_err(dev, "no mmio space\n");
> @@ -171,12 +177,19 @@ static int __devexit ahci_remove(struct platform_device *pdev)
> return 0;
> }
>
> +static const struct platform_device_id ahci_pltfm_ids[] = {
s/pltfm/platform/ to match the rest of the driver.
On the next resend, feel free to add my
Acked-by: Anton Vorontsov <cbouatmailru@gmail.com>
Thanks!
--
Anton Vorontsov
Email: cbouatmailru@gmail.com
WARNING: multiple messages have this Message-ID (diff)
From: cbouatmailru@gmail.com (Anton Vorontsov)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v4 2/3] ahci_platform: switch to module device table matching
Date: Sun, 9 Jan 2011 05:56:18 +0300 [thread overview]
Message-ID: <20110109025618.GA27507@oksana.dev.rtsoft.ru> (raw)
In-Reply-To: <1294537775-21714-3-git-send-email-mkl0301@gmail.com>
On Sun, Jan 09, 2011 at 09:49:34AM +0800, mkl0301 at gmail.com wrote:
> From: Mac Lin <mkl0301@gmail.com>
>
> Switch the driver to use module device table matching mechanism to add SoC-specific parts to the generic driver.
>
> Signed-off-by: Mac Lin <mkl0301@gmail.com>
> ---
> drivers/ata/ahci_platform.c | 14 +++++++++++++-
> drivers/ata/ahci_platforms.h | 16 ++++++++++++++++
I think header and .c file names should match. I.e. just
ahci_platform.h.
> 2 files changed, 29 insertions(+), 1 deletions(-)
> create mode 100644 drivers/ata/ahci_platforms.h
>
> diff --git a/drivers/ata/ahci_platform.c b/drivers/ata/ahci_platform.c
> index 6fef1fa..190db2c 100644
> --- a/drivers/ata/ahci_platform.c
> +++ b/drivers/ata/ahci_platform.c
> @@ -19,9 +19,11 @@
> #include <linux/interrupt.h>
> #include <linux/device.h>
> #include <linux/platform_device.h>
> +#include <linux/mod_devicetable.h>
> #include <linux/libata.h>
> #include <linux/ahci_platform.h>
> #include "ahci.h"
> +#include "ahci_platforms.h"
>
> static struct scsi_host_template ahci_platform_sht = {
> AHCI_SHT("ahci_platform"),
> @@ -29,6 +31,7 @@ static struct scsi_host_template ahci_platform_sht = {
>
> static int __init ahci_probe(struct platform_device *pdev)
> {
> + const struct platform_device_id *platid = platform_get_device_id(pdev);
> struct device *dev = &pdev->dev;
> struct ahci_platform_data *pdata = dev->platform_data;
> struct ata_port_info pi = {
> @@ -46,6 +49,9 @@ static int __init ahci_probe(struct platform_device *pdev)
> int i;
> int rc;
>
> + if (!pdata && platid && platid->driver_data)
> + pdata = (void *)platid->driver_data;
> +
> mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> if (!mem) {
> dev_err(dev, "no mmio space\n");
> @@ -171,12 +177,19 @@ static int __devexit ahci_remove(struct platform_device *pdev)
> return 0;
> }
>
> +static const struct platform_device_id ahci_pltfm_ids[] = {
s/pltfm/platform/ to match the rest of the driver.
On the next resend, feel free to add my
Acked-by: Anton Vorontsov <cbouatmailru@gmail.com>
Thanks!
--
Anton Vorontsov
Email: cbouatmailru at gmail.com
next prev parent reply other threads:[~2011-01-09 2:56 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-09 1:49 [PATCH v4 0/3] add CNS3xxx AHCI support mkl0301
2011-01-09 1:49 ` mkl0301 at gmail.com
2011-01-09 1:49 ` [PATCH v4 1/3] ahci_platform: rename module ahci_platform to ahci_platforms mkl0301
2011-01-09 1:49 ` mkl0301 at gmail.com
2011-01-09 3:03 ` Anton Vorontsov
2011-01-09 3:03 ` Anton Vorontsov
2011-01-09 1:49 ` [PATCH v4 2/3] ahci_platform: switch to module device table matching mkl0301
2011-01-09 1:49 ` mkl0301 at gmail.com
2011-01-09 2:56 ` Anton Vorontsov [this message]
2011-01-09 2:56 ` Anton Vorontsov
2011-01-09 1:49 ` [PATCH v4 3/3] ahci_platforms: add support for CNS3xxx SoC devices mkl0301
2011-01-09 1:49 ` mkl0301 at gmail.com
2011-01-09 3:02 ` Anton Vorontsov
2011-01-09 3:02 ` Anton Vorontsov
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=20110109025618.GA27507@oksana.dev.rtsoft.ru \
--to=cbouatmailru@gmail.com \
--cc=htejun@gmail.com \
--cc=jgarzik@pobox.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-ide@vger.kernel.org \
--cc=mkl0301@gmail.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.