WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH 2] xen pvfb: remove driver_data direct access of stru

To: jeremy@xxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH 2] xen pvfb: remove driver_data direct access of struct device
From: Roel Kluin <roel.kluin@xxxxxxxxx>
Date: Mon, 11 May 2009 21:13:32 +0200
Cc: virtualization@xxxxxxxxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxx, lkml <linux-kernel@xxxxxxxxxxxxxxx>
Delivery-date: Tue, 12 May 2009 12:20:58 -0700
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=45X6QY/U4rR0yq7M6Ze2pmATipNMjo50Xwdgel2aaf4=; b=hp8BtwSNnpmf4bhACPgf56ydq9NNI0kV2EfUdJ6Yem7opvZQw+iciugWsycbeMC4kz 0ZYuCpGXaq1ZiAB9+wGQoMLAmfww4p5Kv5Iocz6nnWVuxpu9vLysKUuiG3pnNcUYSwuX vYp4ttYAWuGzTsM3yudP7RADDeW6pccp8yruw=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; b=HNrtX7rMjIvOzFxUq72uxQzUCbL08GOyx4lvk5Q/DNlgQu/k0nAWgPx16BHRXmM1Qc iyguXL+X5cSfHpKEMDG11LwP1iq+uSsMPzAdnyQlAMg68HnjrEXZLilZfQBX0iRhPupv TkqWib0LxUy5pX5mXkni9YwkeBZan6k3MseWE=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4A08775C.20305@xxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <4A08775C.20305@xxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 2.0.0.21 (X11/20090302)
To avoid direct access to the driver_data pointer in struct device, the
functions dev_get_drvdata() and dev_set_drvdata() should be used.

Signed-off-by: Roel Kluin <roel.kluin@xxxxxxxxx>
---
And another few, also see http://lkml.org/lkml/2009/5/4/353

diff --git a/drivers/video/xen-fbfront.c b/drivers/video/xen-fbfront.c
index 2493f05..15502d5 100644
--- a/drivers/video/xen-fbfront.c
+++ b/drivers/video/xen-fbfront.c
@@ -384,7 +384,7 @@ static int __devinit xenfb_probe(struct xenbus_device *dev,
                fb_size = XENFB_DEFAULT_FB_LEN;
        }
 
-       dev->dev.driver_data = info;
+       dev_set_drvdata(&dev->dev, info);
        info->xbdev = dev;
        info->irq = -1;
        info->x1 = info->y1 = INT_MAX;
@@ -503,7 +503,7 @@ xenfb_make_preferred_console(void)
 
 static int xenfb_resume(struct xenbus_device *dev)
 {
-       struct xenfb_info *info = dev->dev.driver_data;
+       struct xenfb_info *info = dev_get_drvdata(&dev->dev);
 
        xenfb_disconnect_backend(info);
        xenfb_init_shared_page(info, info->fb_info);
@@ -512,7 +512,7 @@ static int xenfb_resume(struct xenbus_device *dev)
 
 static int xenfb_remove(struct xenbus_device *dev)
 {
-       struct xenfb_info *info = dev->dev.driver_data;
+       struct xenfb_info *info = dev_get_drvdata(&dev->dev);
 
        xenfb_disconnect_backend(info);
        if (info->fb_info) {
@@ -621,7 +621,7 @@ static void xenfb_disconnect_backend(struct xenfb_info 
*info)
 static void xenfb_backend_changed(struct xenbus_device *dev,
                                  enum xenbus_state backend_state)
 {
-       struct xenfb_info *info = dev->dev.driver_data;
+       struct xenfb_info *info = dev_get_drvdata(&dev->dev);
        int val;
 
        switch (backend_state) {

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>