public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Grant Likely <grant.likely@secretlab.ca>
To: linux-kernel@vger.kernel.org,
	linux-fbdev-devel@lists.sourceforge.net,
	akonovalov@ru.mvista.com, linuxppc@ozlabs.org, adaplas@gmail.com
Subject: [PATCH 5/6] Xilinxfb: cleanup platform_bus binding to use platform	bus API.
Date: Mon, 01 Oct 2007 09:57:54 -0600	[thread overview]
Message-ID: <20071001155754.6114.6830.stgit@trillian.cg.shawcable.net> (raw)
In-Reply-To: <20071001155024.6114.47993.stgit@trillian.cg.shawcable.net>

From: Grant Likely <grant.likely@secretlab.ca>

Change the platform bus binding to make use of the established
platform_bus API.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
---

 drivers/video/xilinxfb.c |   32 ++++++++++++++++----------------
 1 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/drivers/video/xilinxfb.c b/drivers/video/xilinxfb.c
index 12d9127..e482bb5 100644
--- a/drivers/video/xilinxfb.c
+++ b/drivers/video/xilinxfb.c
@@ -339,26 +339,24 @@ static int xilinxfb_release(struct device *dev)
  */
 
 static int
-xilinxfb_drv_probe(struct device *dev)
+xilinxfb_platform_probe(struct platform_device *pdev)
 {
-	struct platform_device *pdev;
 	struct xilinxfb_platform_data *pdata;
 	struct resource *res;
 	int width_mm;
 	int height_mm;
 	int rotate;
 
-	pdev = to_platform_device(dev);
 	pdata = pdev->dev.platform_data;
 	if (!pdata) {
-		dev_err(dev, "Missing pdata structure\n");
+		dev_err(&pdev->dev, "Missing pdata structure\n");
 		return -ENODEV;
 	}
 
 	/* Find the registers address */
 	res = platform_get_resource(pdev, IORESOURCE_IO, 0);
 	if (!res) {
-		dev_err(dev, "Couldn't get registers resource\n");
+		dev_err(&pdev->dev, "Couldn't get registers resource\n");
 		return -ENODEV;
 	}
 
@@ -366,22 +364,24 @@ xilinxfb_drv_probe(struct device *dev)
 	width_mm = pdata->screen_width_mm;
 	rotate = pdata->rotate_screen ? 1 : 0;
 
-	return xilinxfb_assign(dev, res->start, width_mm, height_mm, rotate);
+	return xilinxfb_assign(&pdev->dev, res->start, width_mm, height_mm,
+			       rotate);
 }
 
 static int
-xilinxfb_drv_remove(struct device *dev)
+xilinxfb_platform_remove(struct platform_device *pdev)
 {
-	return xilinxfb_release(dev);
+	return xilinxfb_release(&pdev->dev);
 }
 
 
-static struct device_driver xilinxfb_driver = {
-	.name		= DRIVER_NAME,
-	.bus		= &platform_bus_type,
-
-	.probe		= xilinxfb_drv_probe,
-	.remove		= xilinxfb_drv_remove
+static struct platform_driver xilinxfb_platform_driver = {
+	.probe		= xilinxfb_platform_probe,
+	.remove		= xilinxfb_platform_remove,
+	.driver = {
+		.owner = THIS_MODULE,
+		.name = DRIVER_NAME,
+	},
 };
 
 static int __init
@@ -391,13 +391,13 @@ xilinxfb_init(void)
 	 * No kernel boot options used,
 	 * so we just need to register the driver
 	 */
-	return driver_register(&xilinxfb_driver);
+	return platform_driver_register(&xilinxfb_platform_driver);
 }
 
 static void __exit
 xilinxfb_cleanup(void)
 {
-	driver_unregister(&xilinxfb_driver);
+	platform_driver_unregister(&xilinxfb_platform_driver);
 }
 
 module_init(xilinxfb_init);


  parent reply	other threads:[~2007-10-01 15:59 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-01 15:57 [PATCH 0/6] Patch series to add of_platform binding to xilinxfb Grant Likely
2007-10-01 15:57 ` [PATCH 1/6] Xilinxfb: add banner output to probe routine when DEBUG is defined Grant Likely
2007-10-04 12:05   ` Andrei Konovalov
2007-10-01 15:57 ` [PATCH 2/6] Xilinxfb: Replace calls to printk with dev_dbg, dev_err, etc Grant Likely
2007-10-04 12:06   ` Andrei Konovalov
2007-10-01 15:57 ` [PATCH 3/6] Xilinxfb: rename failout labels to reflect failure Grant Likely
2007-10-04 12:06   ` Andrei Konovalov
2007-10-01 15:57 ` [PATCH 4/6] xilinxfb: Split device setup from bus binding Grant Likely
2007-10-04 12:07   ` Andrei Konovalov
2007-10-01 15:57 ` Grant Likely [this message]
2007-10-04 12:07   ` [PATCH 5/6] Xilinxfb: cleanup platform_bus binding to use platform bus API Andrei Konovalov
2007-10-01 15:57 ` [PATCH 6/6] Xilinxfb: add of_platform bus binding Grant Likely
2007-10-01 16:42   ` Akinobu Mita
2007-10-01 16:46     ` Grant Likely
2007-10-04 12:11   ` Andrei Konovalov
2007-10-03  0:15 ` [Linux-fbdev-devel] [PATCH 0/6] Patch series to add of_platform binding to xilinxfb Antonino A. Daplas
2007-10-09  4:43   ` Grant Likely
2007-10-09  5:04     ` Antonino A. Daplas
2007-10-09 17:39       ` Grant Likely
2007-10-09 21:06         ` Antonino A. Daplas

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=20071001155754.6114.6830.stgit@trillian.cg.shawcable.net \
    --to=grant.likely@secretlab.ca \
    --cc=adaplas@gmail.com \
    --cc=akonovalov@ru.mvista.com \
    --cc=linux-fbdev-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc@ozlabs.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