aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/net
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2009-05-04 15:40:54 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2009-06-16 00:30:28 -0400
commitdff59b64af94dc588044d70f3708cb835055c5b6 (patch)
tree5d4069fa0ac280b637b8aa691e71ac3b58a508b5 /drivers/s390/net
parent61616115d748e2eb76c43715383e602b09d9bf50 (diff)
s390: remove driver_data direct access of struct device
In the near future, the driver core is going to not allow direct access to the driver_data pointer in struct device. Instead, the functions dev_get_drvdata() and dev_set_drvdata() should be used. These functions have been around since the beginning, so are backwards compatible with all older kernel versions. Thanks to Sebastian Ott <sebott@linux.vnet.ibm.com> for fixing a few typos in my original version of this patch. Cc: Martin Schwidefsky <schwidefsky@de.ibm.com> Cc: Heiko Carstens <heiko.carstens@de.ibm.com> Cc: Sebastian Ott <sebott@linux.vnet.ibm.com> Cc: linux-s390@vger.kernel.org Cc: linux390@de.ibm.com Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/s390/net')
-rw-r--r--drivers/s390/net/claw.c52
-rw-r--r--drivers/s390/net/lcs.c20
-rw-r--r--drivers/s390/net/lcs.h4
-rw-r--r--drivers/s390/net/netiucv.c47
4 files changed, 62 insertions, 61 deletions
diff --git a/drivers/s390/net/claw.c b/drivers/s390/net/claw.c
index 7b6f46ddf3c3..1b34233cf6d5 100644
--- a/drivers/s390/net/claw.c
+++ b/drivers/s390/net/claw.c
@@ -284,7 +284,7 @@ claw_probe(struct ccwgroup_device *cgdev)
284 if (!get_device(&cgdev->dev)) 284 if (!get_device(&cgdev->dev))
285 return -ENODEV; 285 return -ENODEV;
286 privptr = kzalloc(sizeof(struct claw_privbk), GFP_KERNEL); 286 privptr = kzalloc(sizeof(struct claw_privbk), GFP_KERNEL);
287 cgdev->dev.driver_data = privptr; 287 dev_set_drvdata(&cgdev->dev, privptr);
288 if (privptr == NULL) { 288 if (privptr == NULL) {
289 probe_error(cgdev); 289 probe_error(cgdev);
290 put_device(&cgdev->dev); 290 put_device(&cgdev->dev);
@@ -591,14 +591,14 @@ claw_irq_handler(struct ccw_device *cdev,
591 591
592 CLAW_DBF_TEXT(4, trace, "clawirq"); 592 CLAW_DBF_TEXT(4, trace, "clawirq");
593 /* Bypass all 'unsolicited interrupts' */ 593 /* Bypass all 'unsolicited interrupts' */
594 if (!cdev->dev.driver_data) { 594 privptr = dev_get_drvdata(&cdev->dev);
595 if (!privptr) {
595 dev_warn(&cdev->dev, "An uninitialized CLAW device received an" 596 dev_warn(&cdev->dev, "An uninitialized CLAW device received an"
596 " IRQ, c-%02x d-%02x\n", 597 " IRQ, c-%02x d-%02x\n",
597 irb->scsw.cmd.cstat, irb->scsw.cmd.dstat); 598 irb->scsw.cmd.cstat, irb->scsw.cmd.dstat);
598 CLAW_DBF_TEXT(2, trace, "badirq"); 599 CLAW_DBF_TEXT(2, trace, "badirq");
599 return; 600 return;
600 } 601 }
601 privptr = (struct claw_privbk *)cdev->dev.driver_data;
602 602
603 /* Try to extract channel from driver data. */ 603 /* Try to extract channel from driver data. */
604 if (privptr->channel[READ].cdev == cdev) 604 if (privptr->channel[READ].cdev == cdev)
@@ -1980,9 +1980,9 @@ probe_error( struct ccwgroup_device *cgdev)
1980 struct claw_privbk *privptr; 1980 struct claw_privbk *privptr;
1981 1981
1982 CLAW_DBF_TEXT(4, trace, "proberr"); 1982 CLAW_DBF_TEXT(4, trace, "proberr");
1983 privptr = (struct claw_privbk *) cgdev->dev.driver_data; 1983 privptr = dev_get_drvdata(&cgdev->dev);
1984 if (privptr != NULL) { 1984 if (privptr != NULL) {
1985 cgdev->dev.driver_data = NULL; 1985 dev_set_drvdata(&cgdev->dev, NULL);
1986 kfree(privptr->p_env); 1986 kfree(privptr->p_env);
1987 kfree(privptr->p_mtc_envelope); 1987 kfree(privptr->p_mtc_envelope);
1988 kfree(privptr); 1988 kfree(privptr);
@@ -2911,9 +2911,9 @@ claw_new_device(struct ccwgroup_device *cgdev)
2911 dev_info(&cgdev->dev, "add for %s\n", 2911 dev_info(&cgdev->dev, "add for %s\n",
2912 dev_name(&cgdev->cdev[READ]->dev)); 2912 dev_name(&cgdev->cdev[READ]->dev));
2913 CLAW_DBF_TEXT(2, setup, "new_dev"); 2913 CLAW_DBF_TEXT(2, setup, "new_dev");
2914 privptr = cgdev->dev.driver_data; 2914 privptr = dev_get_drvdata(&cgdev->dev);
2915 cgdev->cdev[READ]->dev.driver_data = privptr; 2915 dev_set_drvdata(&cgdev->cdev[READ]->dev, privptr);
2916 cgdev->cdev[WRITE]->dev.driver_data = privptr; 2916 dev_set_drvdata(&cgdev->cdev[WRITE]->dev, privptr);
2917 if (!privptr) 2917 if (!privptr)
2918 return -ENODEV; 2918 return -ENODEV;
2919 p_env = privptr->p_env; 2919 p_env = privptr->p_env;
@@ -2950,9 +2950,9 @@ claw_new_device(struct ccwgroup_device *cgdev)
2950 goto out; 2950 goto out;
2951 } 2951 }
2952 dev->ml_priv = privptr; 2952 dev->ml_priv = privptr;
2953 cgdev->dev.driver_data = privptr; 2953 dev_set_drvdata(&cgdev->dev, privptr);
2954 cgdev->cdev[READ]->dev.driver_data = privptr; 2954 dev_set_drvdata(&cgdev->cdev[READ]->dev, privptr);
2955 cgdev->cdev[WRITE]->dev.driver_data = privptr; 2955 dev_set_drvdata(&cgdev->cdev[WRITE]->dev, privptr);
2956 /* sysfs magic */ 2956 /* sysfs magic */
2957 SET_NETDEV_DEV(dev, &cgdev->dev); 2957 SET_NETDEV_DEV(dev, &cgdev->dev);
2958 if (register_netdev(dev) != 0) { 2958 if (register_netdev(dev) != 0) {
@@ -3018,7 +3018,7 @@ claw_shutdown_device(struct ccwgroup_device *cgdev)
3018 int ret; 3018 int ret;
3019 3019
3020 CLAW_DBF_TEXT_(2, setup, "%s", dev_name(&cgdev->dev)); 3020 CLAW_DBF_TEXT_(2, setup, "%s", dev_name(&cgdev->dev));
3021 priv = cgdev->dev.driver_data; 3021 priv = dev_get_drvdata(&cgdev->dev);
3022 if (!priv) 3022 if (!priv)
3023 return -ENODEV; 3023 return -ENODEV;
3024 ndev = priv->channel[READ].ndev; 3024 ndev = priv->channel[READ].ndev;
@@ -3048,7 +3048,7 @@ claw_remove_device(struct ccwgroup_device *cgdev)
3048 3048
3049 BUG_ON(!cgdev); 3049 BUG_ON(!cgdev);
3050 CLAW_DBF_TEXT_(2, setup, "%s", dev_name(&cgdev->dev)); 3050 CLAW_DBF_TEXT_(2, setup, "%s", dev_name(&cgdev->dev));
3051 priv = cgdev->dev.driver_data; 3051 priv = dev_get_drvdata(&cgdev->dev);
3052 BUG_ON(!priv); 3052 BUG_ON(!priv);
3053 dev_info(&cgdev->dev, " will be removed.\n"); 3053 dev_info(&cgdev->dev, " will be removed.\n");
3054 if (cgdev->state == CCWGROUP_ONLINE) 3054 if (cgdev->state == CCWGROUP_ONLINE)
@@ -3063,9 +3063,9 @@ claw_remove_device(struct ccwgroup_device *cgdev)
3063 kfree(priv->channel[1].irb); 3063 kfree(priv->channel[1].irb);
3064 priv->channel[1].irb=NULL; 3064 priv->channel[1].irb=NULL;
3065 kfree(priv); 3065 kfree(priv);
3066 cgdev->dev.driver_data=NULL; 3066 dev_set_drvdata(&cgdev->dev, NULL);
3067 cgdev->cdev[READ]->dev.driver_data = NULL; 3067 dev_set_drvdata(&cgdev->cdev[READ]->dev, NULL);
3068 cgdev->cdev[WRITE]->dev.driver_data = NULL; 3068 dev_set_drvdata(&cgdev->cdev[WRITE]->dev, NULL);
3069 put_device(&cgdev->dev); 3069 put_device(&cgdev->dev);
3070 3070
3071 return; 3071 return;
@@ -3081,7 +3081,7 @@ claw_hname_show(struct device *dev, struct device_attribute *attr, char *buf)
3081 struct claw_privbk *priv; 3081 struct claw_privbk *priv;
3082 struct claw_env * p_env; 3082 struct claw_env * p_env;
3083 3083
3084 priv = dev->driver_data; 3084 priv = dev_get_drvdata(dev);
3085 if (!priv) 3085 if (!priv)
3086 return -ENODEV; 3086 return -ENODEV;
3087 p_env = priv->p_env; 3087 p_env = priv->p_env;
@@ -3095,7 +3095,7 @@ claw_hname_write(struct device *dev, struct device_attribute *attr,
3095 struct claw_privbk *priv; 3095 struct claw_privbk *priv;
3096 struct claw_env * p_env; 3096 struct claw_env * p_env;
3097 3097
3098 priv = dev->driver_data; 3098 priv = dev_get_drvdata(dev);
3099 if (!priv) 3099 if (!priv)
3100 return -ENODEV; 3100 return -ENODEV;
3101 p_env = priv->p_env; 3101 p_env = priv->p_env;
@@ -3119,7 +3119,7 @@ claw_adname_show(struct device *dev, struct device_attribute *attr, char *buf)
3119 struct claw_privbk *priv; 3119 struct claw_privbk *priv;
3120 struct claw_env * p_env; 3120 struct claw_env * p_env;
3121 3121
3122 priv = dev->driver_data; 3122 priv = dev_get_drvdata(dev);
3123 if (!priv) 3123 if (!priv)
3124 return -ENODEV; 3124 return -ENODEV;
3125 p_env = priv->p_env; 3125 p_env = priv->p_env;
@@ -3133,7 +3133,7 @@ claw_adname_write(struct device *dev, struct device_attribute *attr,
3133 struct claw_privbk *priv; 3133 struct claw_privbk *priv;
3134 struct claw_env * p_env; 3134 struct claw_env * p_env;
3135 3135
3136 priv = dev->driver_data; 3136 priv = dev_get_drvdata(dev);
3137 if (!priv) 3137 if (!priv)
3138 return -ENODEV; 3138 return -ENODEV;
3139 p_env = priv->p_env; 3139 p_env = priv->p_env;
@@ -3157,7 +3157,7 @@ claw_apname_show(struct device *dev, struct device_attribute *attr, char *buf)
3157 struct claw_privbk *priv; 3157 struct claw_privbk *priv;
3158 struct claw_env * p_env; 3158 struct claw_env * p_env;
3159 3159
3160 priv = dev->driver_data; 3160 priv = dev_get_drvdata(dev);
3161 if (!priv) 3161 if (!priv)
3162 return -ENODEV; 3162 return -ENODEV;
3163 p_env = priv->p_env; 3163 p_env = priv->p_env;
@@ -3172,7 +3172,7 @@ claw_apname_write(struct device *dev, struct device_attribute *attr,
3172 struct claw_privbk *priv; 3172 struct claw_privbk *priv;
3173 struct claw_env * p_env; 3173 struct claw_env * p_env;
3174 3174
3175 priv = dev->driver_data; 3175 priv = dev_get_drvdata(dev);
3176 if (!priv) 3176 if (!priv)
3177 return -ENODEV; 3177 return -ENODEV;
3178 p_env = priv->p_env; 3178 p_env = priv->p_env;
@@ -3206,7 +3206,7 @@ claw_wbuff_show(struct device *dev, struct device_attribute *attr, char *buf)
3206 struct claw_privbk *priv; 3206 struct claw_privbk *priv;
3207 struct claw_env * p_env; 3207 struct claw_env * p_env;
3208 3208
3209 priv = dev->driver_data; 3209 priv = dev_get_drvdata(dev);
3210 if (!priv) 3210 if (!priv)
3211 return -ENODEV; 3211 return -ENODEV;
3212 p_env = priv->p_env; 3212 p_env = priv->p_env;
@@ -3221,7 +3221,7 @@ claw_wbuff_write(struct device *dev, struct device_attribute *attr,
3221 struct claw_env * p_env; 3221 struct claw_env * p_env;
3222 int nnn,max; 3222 int nnn,max;
3223 3223
3224 priv = dev->driver_data; 3224 priv = dev_get_drvdata(dev);
3225 if (!priv) 3225 if (!priv)
3226 return -ENODEV; 3226 return -ENODEV;
3227 p_env = priv->p_env; 3227 p_env = priv->p_env;
@@ -3248,7 +3248,7 @@ claw_rbuff_show(struct device *dev, struct device_attribute *attr, char *buf)
3248 struct claw_privbk *priv; 3248 struct claw_privbk *priv;
3249 struct claw_env * p_env; 3249 struct claw_env * p_env;
3250 3250
3251 priv = dev->driver_data; 3251 priv = dev_get_drvdata(dev);
3252 if (!priv) 3252 if (!priv)
3253 return -ENODEV; 3253 return -ENODEV;
3254 p_env = priv->p_env; 3254 p_env = priv->p_env;
@@ -3263,7 +3263,7 @@ claw_rbuff_write(struct device *dev, struct device_attribute *attr,
3263 struct claw_env *p_env; 3263 struct claw_env *p_env;
3264 int nnn,max; 3264 int nnn,max;
3265 3265
3266 priv = dev->driver_data; 3266 priv = dev_get_drvdata(dev);
3267 if (!priv) 3267 if (!priv)
3268 return -ENODEV; 3268 return -ENODEV;
3269 p_env = priv->p_env; 3269 p_env = priv->p_env;
diff --git a/drivers/s390/net/lcs.c b/drivers/s390/net/lcs.c
index a45bc24eb5f9..ba6d45d29ad4 100644
--- a/drivers/s390/net/lcs.c
+++ b/drivers/s390/net/lcs.c
@@ -1939,7 +1939,7 @@ lcs_portno_show (struct device *dev, struct device_attribute *attr, char *buf)
1939{ 1939{
1940 struct lcs_card *card; 1940 struct lcs_card *card;
1941 1941
1942 card = (struct lcs_card *)dev->driver_data; 1942 card = dev_get_drvdata(dev);
1943 1943
1944 if (!card) 1944 if (!card)
1945 return 0; 1945 return 0;
@@ -1956,7 +1956,7 @@ lcs_portno_store (struct device *dev, struct device_attribute *attr, const char
1956 struct lcs_card *card; 1956 struct lcs_card *card;
1957 int value; 1957 int value;
1958 1958
1959 card = (struct lcs_card *)dev->driver_data; 1959 card = dev_get_drvdata(dev);
1960 1960
1961 if (!card) 1961 if (!card)
1962 return 0; 1962 return 0;
@@ -1990,7 +1990,7 @@ lcs_timeout_show(struct device *dev, struct device_attribute *attr, char *buf)
1990{ 1990{
1991 struct lcs_card *card; 1991 struct lcs_card *card;
1992 1992
1993 card = (struct lcs_card *)dev->driver_data; 1993 card = dev_get_drvdata(dev);
1994 1994
1995 return card ? sprintf(buf, "%u\n", card->lancmd_timeout) : 0; 1995 return card ? sprintf(buf, "%u\n", card->lancmd_timeout) : 0;
1996} 1996}
@@ -2001,7 +2001,7 @@ lcs_timeout_store (struct device *dev, struct device_attribute *attr, const char
2001 struct lcs_card *card; 2001 struct lcs_card *card;
2002 int value; 2002 int value;
2003 2003
2004 card = (struct lcs_card *)dev->driver_data; 2004 card = dev_get_drvdata(dev);
2005 2005
2006 if (!card) 2006 if (!card)
2007 return 0; 2007 return 0;
@@ -2020,7 +2020,7 @@ static ssize_t
2020lcs_dev_recover_store(struct device *dev, struct device_attribute *attr, 2020lcs_dev_recover_store(struct device *dev, struct device_attribute *attr,
2021 const char *buf, size_t count) 2021 const char *buf, size_t count)
2022{ 2022{
2023 struct lcs_card *card = dev->driver_data; 2023 struct lcs_card *card = dev_get_drvdata(dev);
2024 char *tmp; 2024 char *tmp;
2025 int i; 2025 int i;
2026 2026
@@ -2073,7 +2073,7 @@ lcs_probe_device(struct ccwgroup_device *ccwgdev)
2073 put_device(&ccwgdev->dev); 2073 put_device(&ccwgdev->dev);
2074 return ret; 2074 return ret;
2075 } 2075 }
2076 ccwgdev->dev.driver_data = card; 2076 dev_set_drvdata(&ccwgdev->dev, card);
2077 ccwgdev->cdev[0]->handler = lcs_irq; 2077 ccwgdev->cdev[0]->handler = lcs_irq;
2078 ccwgdev->cdev[1]->handler = lcs_irq; 2078 ccwgdev->cdev[1]->handler = lcs_irq;
2079 card->gdev = ccwgdev; 2079 card->gdev = ccwgdev;
@@ -2090,7 +2090,7 @@ lcs_register_netdev(struct ccwgroup_device *ccwgdev)
2090 struct lcs_card *card; 2090 struct lcs_card *card;
2091 2091
2092 LCS_DBF_TEXT(2, setup, "regnetdv"); 2092 LCS_DBF_TEXT(2, setup, "regnetdv");
2093 card = (struct lcs_card *)ccwgdev->dev.driver_data; 2093 card = dev_get_drvdata(&ccwgdev->dev);
2094 if (card->dev->reg_state != NETREG_UNINITIALIZED) 2094 if (card->dev->reg_state != NETREG_UNINITIALIZED)
2095 return 0; 2095 return 0;
2096 SET_NETDEV_DEV(card->dev, &ccwgdev->dev); 2096 SET_NETDEV_DEV(card->dev, &ccwgdev->dev);
@@ -2123,7 +2123,7 @@ lcs_new_device(struct ccwgroup_device *ccwgdev)
2123 enum lcs_dev_states recover_state; 2123 enum lcs_dev_states recover_state;
2124 int rc; 2124 int rc;
2125 2125
2126 card = (struct lcs_card *)ccwgdev->dev.driver_data; 2126 card = dev_get_drvdata(&ccwgdev->dev);
2127 if (!card) 2127 if (!card)
2128 return -ENODEV; 2128 return -ENODEV;
2129 2129
@@ -2229,7 +2229,7 @@ __lcs_shutdown_device(struct ccwgroup_device *ccwgdev, int recovery_mode)
2229 int ret; 2229 int ret;
2230 2230
2231 LCS_DBF_TEXT(3, setup, "shtdndev"); 2231 LCS_DBF_TEXT(3, setup, "shtdndev");
2232 card = (struct lcs_card *)ccwgdev->dev.driver_data; 2232 card = dev_get_drvdata(&ccwgdev->dev);
2233 if (!card) 2233 if (!card)
2234 return -ENODEV; 2234 return -ENODEV;
2235 if (recovery_mode == 0) { 2235 if (recovery_mode == 0) {
@@ -2296,7 +2296,7 @@ lcs_remove_device(struct ccwgroup_device *ccwgdev)
2296{ 2296{
2297 struct lcs_card *card; 2297 struct lcs_card *card;
2298 2298
2299 card = (struct lcs_card *)ccwgdev->dev.driver_data; 2299 card = dev_get_drvdata(&ccwgdev->dev);
2300 if (!card) 2300 if (!card)
2301 return; 2301 return;
2302 2302
diff --git a/drivers/s390/net/lcs.h b/drivers/s390/net/lcs.h
index d58fea52557d..6d668642af27 100644
--- a/drivers/s390/net/lcs.h
+++ b/drivers/s390/net/lcs.h
@@ -34,8 +34,8 @@ static inline int lcs_dbf_passes(debug_info_t *dbf_grp, int level)
34 * sysfs related stuff 34 * sysfs related stuff
35 */ 35 */
36#define CARD_FROM_DEV(cdev) \ 36#define CARD_FROM_DEV(cdev) \
37 (struct lcs_card *) \ 37 (struct lcs_card *) dev_get_drvdata( \
38 ((struct ccwgroup_device *)cdev->dev.driver_data)->dev.driver_data; 38 &((struct ccwgroup_device *)dev_get_drvdata(&cdev->dev))->dev);
39/** 39/**
40 * CCW commands used in this driver 40 * CCW commands used in this driver
41 */ 41 */
diff --git a/drivers/s390/net/netiucv.c b/drivers/s390/net/netiucv.c
index aec9e5d3cf4b..d52a99f9b702 100644
--- a/drivers/s390/net/netiucv.c
+++ b/drivers/s390/net/netiucv.c
@@ -1364,7 +1364,7 @@ static int netiucv_change_mtu(struct net_device * dev, int new_mtu)
1364static ssize_t user_show(struct device *dev, struct device_attribute *attr, 1364static ssize_t user_show(struct device *dev, struct device_attribute *attr,
1365 char *buf) 1365 char *buf)
1366{ 1366{
1367 struct netiucv_priv *priv = dev->driver_data; 1367 struct netiucv_priv *priv = dev_get_drvdata(dev);
1368 1368
1369 IUCV_DBF_TEXT(trace, 5, __func__); 1369 IUCV_DBF_TEXT(trace, 5, __func__);
1370 return sprintf(buf, "%s\n", netiucv_printname(priv->conn->userid)); 1370 return sprintf(buf, "%s\n", netiucv_printname(priv->conn->userid));
@@ -1373,7 +1373,7 @@ static ssize_t user_show(struct device *dev, struct device_attribute *attr,
1373static ssize_t user_write(struct device *dev, struct device_attribute *attr, 1373static ssize_t user_write(struct device *dev, struct device_attribute *attr,
1374 const char *buf, size_t count) 1374 const char *buf, size_t count)
1375{ 1375{
1376 struct netiucv_priv *priv = dev->driver_data; 1376 struct netiucv_priv *priv = dev_get_drvdata(dev);
1377 struct net_device *ndev = priv->conn->netdev; 1377 struct net_device *ndev = priv->conn->netdev;
1378 char *p; 1378 char *p;
1379 char *tmp; 1379 char *tmp;
@@ -1430,7 +1430,8 @@ static DEVICE_ATTR(user, 0644, user_show, user_write);
1430 1430
1431static ssize_t buffer_show (struct device *dev, struct device_attribute *attr, 1431static ssize_t buffer_show (struct device *dev, struct device_attribute *attr,
1432 char *buf) 1432 char *buf)
1433{ struct netiucv_priv *priv = dev->driver_data; 1433{
1434 struct netiucv_priv *priv = dev_get_drvdata(dev);
1434 1435
1435 IUCV_DBF_TEXT(trace, 5, __func__); 1436 IUCV_DBF_TEXT(trace, 5, __func__);
1436 return sprintf(buf, "%d\n", priv->conn->max_buffsize); 1437 return sprintf(buf, "%d\n", priv->conn->max_buffsize);
@@ -1439,7 +1440,7 @@ static ssize_t buffer_show (struct device *dev, struct device_attribute *attr,
1439static ssize_t buffer_write (struct device *dev, struct device_attribute *attr, 1440static ssize_t buffer_write (struct device *dev, struct device_attribute *attr,
1440 const char *buf, size_t count) 1441 const char *buf, size_t count)
1441{ 1442{
1442 struct netiucv_priv *priv = dev->driver_data; 1443 struct netiucv_priv *priv = dev_get_drvdata(dev);
1443 struct net_device *ndev = priv->conn->netdev; 1444 struct net_device *ndev = priv->conn->netdev;
1444 char *e; 1445 char *e;
1445 int bs1; 1446 int bs1;
@@ -1487,7 +1488,7 @@ static DEVICE_ATTR(buffer, 0644, buffer_show, buffer_write);
1487static ssize_t dev_fsm_show (struct device *dev, struct device_attribute *attr, 1488static ssize_t dev_fsm_show (struct device *dev, struct device_attribute *attr,
1488 char *buf) 1489 char *buf)
1489{ 1490{
1490 struct netiucv_priv *priv = dev->driver_data; 1491 struct netiucv_priv *priv = dev_get_drvdata(dev);
1491 1492
1492 IUCV_DBF_TEXT(trace, 5, __func__); 1493 IUCV_DBF_TEXT(trace, 5, __func__);
1493 return sprintf(buf, "%s\n", fsm_getstate_str(priv->fsm)); 1494 return sprintf(buf, "%s\n", fsm_getstate_str(priv->fsm));
@@ -1498,7 +1499,7 @@ static DEVICE_ATTR(device_fsm_state, 0444, dev_fsm_show, NULL);
1498static ssize_t conn_fsm_show (struct device *dev, 1499static ssize_t conn_fsm_show (struct device *dev,
1499 struct device_attribute *attr, char *buf) 1500 struct device_attribute *attr, char *buf)
1500{ 1501{
1501 struct netiucv_priv *priv = dev->driver_data; 1502 struct netiucv_priv *priv = dev_get_drvdata(dev);
1502 1503
1503 IUCV_DBF_TEXT(trace, 5, __func__); 1504 IUCV_DBF_TEXT(trace, 5, __func__);
1504 return sprintf(buf, "%s\n", fsm_getstate_str(priv->conn->fsm)); 1505 return sprintf(buf, "%s\n", fsm_getstate_str(priv->conn->fsm));
@@ -1509,7 +1510,7 @@ static DEVICE_ATTR(connection_fsm_state, 0444, conn_fsm_show, NULL);
1509static ssize_t maxmulti_show (struct device *dev, 1510static ssize_t maxmulti_show (struct device *dev,
1510 struct device_attribute *attr, char *buf) 1511 struct device_attribute *attr, char *buf)
1511{ 1512{
1512 struct netiucv_priv *priv = dev->driver_data; 1513 struct netiucv_priv *priv = dev_get_drvdata(dev);
1513 1514
1514 IUCV_DBF_TEXT(trace, 5, __func__); 1515 IUCV_DBF_TEXT(trace, 5, __func__);
1515 return sprintf(buf, "%ld\n", priv->conn->prof.maxmulti); 1516 return sprintf(buf, "%ld\n", priv->conn->prof.maxmulti);
@@ -1519,7 +1520,7 @@ static ssize_t maxmulti_write (struct device *dev,
1519 struct device_attribute *attr, 1520 struct device_attribute *attr,
1520 const char *buf, size_t count) 1521 const char *buf, size_t count)
1521{ 1522{
1522 struct netiucv_priv *priv = dev->driver_data; 1523 struct netiucv_priv *priv = dev_get_drvdata(dev);
1523 1524
1524 IUCV_DBF_TEXT(trace, 4, __func__); 1525 IUCV_DBF_TEXT(trace, 4, __func__);
1525 priv->conn->prof.maxmulti = 0; 1526 priv->conn->prof.maxmulti = 0;
@@ -1531,7 +1532,7 @@ static DEVICE_ATTR(max_tx_buffer_used, 0644, maxmulti_show, maxmulti_write);
1531static ssize_t maxcq_show (struct device *dev, struct device_attribute *attr, 1532static ssize_t maxcq_show (struct device *dev, struct device_attribute *attr,
1532 char *buf) 1533 char *buf)
1533{ 1534{
1534 struct netiucv_priv *priv = dev->driver_data; 1535 struct netiucv_priv *priv = dev_get_drvdata(dev);
1535 1536
1536 IUCV_DBF_TEXT(trace, 5, __func__); 1537 IUCV_DBF_TEXT(trace, 5, __func__);
1537 return sprintf(buf, "%ld\n", priv->conn->prof.maxcqueue); 1538 return sprintf(buf, "%ld\n", priv->conn->prof.maxcqueue);
@@ -1540,7 +1541,7 @@ static ssize_t maxcq_show (struct device *dev, struct device_attribute *attr,
1540static ssize_t maxcq_write (struct device *dev, struct device_attribute *attr, 1541static ssize_t maxcq_write (struct device *dev, struct device_attribute *attr,
1541 const char *buf, size_t count) 1542 const char *buf, size_t count)
1542{ 1543{
1543 struct netiucv_priv *priv = dev->driver_data; 1544 struct netiucv_priv *priv = dev_get_drvdata(dev);
1544 1545
1545 IUCV_DBF_TEXT(trace, 4, __func__); 1546 IUCV_DBF_TEXT(trace, 4, __func__);
1546 priv->conn->prof.maxcqueue = 0; 1547 priv->conn->prof.maxcqueue = 0;
@@ -1552,7 +1553,7 @@ static DEVICE_ATTR(max_chained_skbs, 0644, maxcq_show, maxcq_write);
1552static ssize_t sdoio_show (struct device *dev, struct device_attribute *attr, 1553static ssize_t sdoio_show (struct device *dev, struct device_attribute *attr,
1553 char *buf) 1554 char *buf)
1554{ 1555{
1555 struct netiucv_priv *priv = dev->driver_data; 1556 struct netiucv_priv *priv = dev_get_drvdata(dev);
1556 1557
1557 IUCV_DBF_TEXT(trace, 5, __func__); 1558 IUCV_DBF_TEXT(trace, 5, __func__);
1558 return sprintf(buf, "%ld\n", priv->conn->prof.doios_single); 1559 return sprintf(buf, "%ld\n", priv->conn->prof.doios_single);
@@ -1561,7 +1562,7 @@ static ssize_t sdoio_show (struct device *dev, struct device_attribute *attr,
1561static ssize_t sdoio_write (struct device *dev, struct device_attribute *attr, 1562static ssize_t sdoio_write (struct device *dev, struct device_attribute *attr,
1562 const char *buf, size_t count) 1563 const char *buf, size_t count)
1563{ 1564{
1564 struct netiucv_priv *priv = dev->driver_data; 1565 struct netiucv_priv *priv = dev_get_drvdata(dev);
1565 1566
1566 IUCV_DBF_TEXT(trace, 4, __func__); 1567 IUCV_DBF_TEXT(trace, 4, __func__);
1567 priv->conn->prof.doios_single = 0; 1568 priv->conn->prof.doios_single = 0;
@@ -1573,7 +1574,7 @@ static DEVICE_ATTR(tx_single_write_ops, 0644, sdoio_show, sdoio_write);
1573static ssize_t mdoio_show (struct device *dev, struct device_attribute *attr, 1574static ssize_t mdoio_show (struct device *dev, struct device_attribute *attr,
1574 char *buf) 1575 char *buf)
1575{ 1576{
1576 struct netiucv_priv *priv = dev->driver_data; 1577 struct netiucv_priv *priv = dev_get_drvdata(dev);
1577 1578
1578 IUCV_DBF_TEXT(trace, 5, __func__); 1579 IUCV_DBF_TEXT(trace, 5, __func__);
1579 return sprintf(buf, "%ld\n", priv->conn->prof.doios_multi); 1580 return sprintf(buf, "%ld\n", priv->conn->prof.doios_multi);
@@ -1582,7 +1583,7 @@ static ssize_t mdoio_show (struct device *dev, struct device_attribute *attr,
1582static ssize_t mdoio_write (struct device *dev, struct device_attribute *attr, 1583static ssize_t mdoio_write (struct device *dev, struct device_attribute *attr,
1583 const char *buf, size_t count) 1584 const char *buf, size_t count)
1584{ 1585{
1585 struct netiucv_priv *priv = dev->driver_data; 1586 struct netiucv_priv *priv = dev_get_drvdata(dev);
1586 1587
1587 IUCV_DBF_TEXT(trace, 5, __func__); 1588 IUCV_DBF_TEXT(trace, 5, __func__);
1588 priv->conn->prof.doios_multi = 0; 1589 priv->conn->prof.doios_multi = 0;
@@ -1594,7 +1595,7 @@ static DEVICE_ATTR(tx_multi_write_ops, 0644, mdoio_show, mdoio_write);
1594static ssize_t txlen_show (struct device *dev, struct device_attribute *attr, 1595static ssize_t txlen_show (struct device *dev, struct device_attribute *attr,
1595 char *buf) 1596 char *buf)
1596{ 1597{
1597 struct netiucv_priv *priv = dev->driver_data; 1598 struct netiucv_priv *priv = dev_get_drvdata(dev);
1598 1599
1599 IUCV_DBF_TEXT(trace, 5, __func__); 1600 IUCV_DBF_TEXT(trace, 5, __func__);
1600 return sprintf(buf, "%ld\n", priv->conn->prof.txlen); 1601 return sprintf(buf, "%ld\n", priv->conn->prof.txlen);
@@ -1603,7 +1604,7 @@ static ssize_t txlen_show (struct device *dev, struct device_attribute *attr,
1603static ssize_t txlen_write (struct device *dev, struct device_attribute *attr, 1604static ssize_t txlen_write (struct device *dev, struct device_attribute *attr,
1604 const char *buf, size_t count) 1605 const char *buf, size_t count)
1605{ 1606{
1606 struct netiucv_priv *priv = dev->driver_data; 1607 struct netiucv_priv *priv = dev_get_drvdata(dev);
1607 1608
1608 IUCV_DBF_TEXT(trace, 4, __func__); 1609 IUCV_DBF_TEXT(trace, 4, __func__);
1609 priv->conn->prof.txlen = 0; 1610 priv->conn->prof.txlen = 0;
@@ -1615,7 +1616,7 @@ static DEVICE_ATTR(netto_bytes, 0644, txlen_show, txlen_write);
1615static ssize_t txtime_show (struct device *dev, struct device_attribute *attr, 1616static ssize_t txtime_show (struct device *dev, struct device_attribute *attr,
1616 char *buf) 1617 char *buf)
1617{ 1618{
1618 struct netiucv_priv *priv = dev->driver_data; 1619 struct netiucv_priv *priv = dev_get_drvdata(dev);
1619 1620
1620 IUCV_DBF_TEXT(trace, 5, __func__); 1621 IUCV_DBF_TEXT(trace, 5, __func__);
1621 return sprintf(buf, "%ld\n", priv->conn->prof.tx_time); 1622 return sprintf(buf, "%ld\n", priv->conn->prof.tx_time);
@@ -1624,7 +1625,7 @@ static ssize_t txtime_show (struct device *dev, struct device_attribute *attr,
1624static ssize_t txtime_write (struct device *dev, struct device_attribute *attr, 1625static ssize_t txtime_write (struct device *dev, struct device_attribute *attr,
1625 const char *buf, size_t count) 1626 const char *buf, size_t count)
1626{ 1627{
1627 struct netiucv_priv *priv = dev->driver_data; 1628 struct netiucv_priv *priv = dev_get_drvdata(dev);
1628 1629
1629 IUCV_DBF_TEXT(trace, 4, __func__); 1630 IUCV_DBF_TEXT(trace, 4, __func__);
1630 priv->conn->prof.tx_time = 0; 1631 priv->conn->prof.tx_time = 0;
@@ -1636,7 +1637,7 @@ static DEVICE_ATTR(max_tx_io_time, 0644, txtime_show, txtime_write);
1636static ssize_t txpend_show (struct device *dev, struct device_attribute *attr, 1637static ssize_t txpend_show (struct device *dev, struct device_attribute *attr,
1637 char *buf) 1638 char *buf)
1638{ 1639{
1639 struct netiucv_priv *priv = dev->driver_data; 1640 struct netiucv_priv *priv = dev_get_drvdata(dev);
1640 1641
1641 IUCV_DBF_TEXT(trace, 5, __func__); 1642 IUCV_DBF_TEXT(trace, 5, __func__);
1642 return sprintf(buf, "%ld\n", priv->conn->prof.tx_pending); 1643 return sprintf(buf, "%ld\n", priv->conn->prof.tx_pending);
@@ -1645,7 +1646,7 @@ static ssize_t txpend_show (struct device *dev, struct device_attribute *attr,
1645static ssize_t txpend_write (struct device *dev, struct device_attribute *attr, 1646static ssize_t txpend_write (struct device *dev, struct device_attribute *attr,
1646 const char *buf, size_t count) 1647 const char *buf, size_t count)
1647{ 1648{
1648 struct netiucv_priv *priv = dev->driver_data; 1649 struct netiucv_priv *priv = dev_get_drvdata(dev);
1649 1650
1650 IUCV_DBF_TEXT(trace, 4, __func__); 1651 IUCV_DBF_TEXT(trace, 4, __func__);
1651 priv->conn->prof.tx_pending = 0; 1652 priv->conn->prof.tx_pending = 0;
@@ -1657,7 +1658,7 @@ static DEVICE_ATTR(tx_pending, 0644, txpend_show, txpend_write);
1657static ssize_t txmpnd_show (struct device *dev, struct device_attribute *attr, 1658static ssize_t txmpnd_show (struct device *dev, struct device_attribute *attr,
1658 char *buf) 1659 char *buf)
1659{ 1660{
1660 struct netiucv_priv *priv = dev->driver_data; 1661 struct netiucv_priv *priv = dev_get_drvdata(dev);
1661 1662
1662 IUCV_DBF_TEXT(trace, 5, __func__); 1663 IUCV_DBF_TEXT(trace, 5, __func__);
1663 return sprintf(buf, "%ld\n", priv->conn->prof.tx_max_pending); 1664 return sprintf(buf, "%ld\n", priv->conn->prof.tx_max_pending);
@@ -1666,7 +1667,7 @@ static ssize_t txmpnd_show (struct device *dev, struct device_attribute *attr,
1666static ssize_t txmpnd_write (struct device *dev, struct device_attribute *attr, 1667static ssize_t txmpnd_write (struct device *dev, struct device_attribute *attr,
1667 const char *buf, size_t count) 1668 const char *buf, size_t count)
1668{ 1669{
1669 struct netiucv_priv *priv = dev->driver_data; 1670 struct netiucv_priv *priv = dev_get_drvdata(dev);
1670 1671
1671 IUCV_DBF_TEXT(trace, 4, __func__); 1672 IUCV_DBF_TEXT(trace, 4, __func__);
1672 priv->conn->prof.tx_max_pending = 0; 1673 priv->conn->prof.tx_max_pending = 0;
@@ -1758,7 +1759,7 @@ static int netiucv_register_device(struct net_device *ndev)
1758 if (ret) 1759 if (ret)
1759 goto out_unreg; 1760 goto out_unreg;
1760 priv->dev = dev; 1761 priv->dev = dev;
1761 dev->driver_data = priv; 1762 dev_set_drvdata(dev, priv);
1762 return 0; 1763 return 0;
1763 1764
1764out_unreg: 1765out_unreg: