Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

s390/net: remove pm support from iucv drivers

Commit 394216275c7d ("s390: remove broken hibernate / power management support")
removed support for ARCH_HIBERNATION_POSSIBLE on s390.
So drop the unused pm ops from the iucv drivers.

CC: Hendrik Brueckner <brueckner@linux.ibm.com>
Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Julian Wiedmann and committed by
David S. Miller
97ccf6f9 fc4a4515

+1 -168
+1 -103
drivers/s390/net/netiucv.c
··· 112 112 */ 113 113 #define PRINTK_HEADER " iucv: " /* for debugging */ 114 114 115 - /* dummy device to make sure netiucv_pm functions are called */ 116 - static struct device *netiucv_dev; 117 - 118 - static int netiucv_pm_prepare(struct device *); 119 - static void netiucv_pm_complete(struct device *); 120 - static int netiucv_pm_freeze(struct device *); 121 - static int netiucv_pm_restore_thaw(struct device *); 122 - 123 - static const struct dev_pm_ops netiucv_pm_ops = { 124 - .prepare = netiucv_pm_prepare, 125 - .complete = netiucv_pm_complete, 126 - .freeze = netiucv_pm_freeze, 127 - .thaw = netiucv_pm_restore_thaw, 128 - .restore = netiucv_pm_restore_thaw, 129 - }; 130 - 131 115 static struct device_driver netiucv_driver = { 132 116 .owner = THIS_MODULE, 133 117 .name = "netiucv", 134 118 .bus = &iucv_bus, 135 - .pm = &netiucv_pm_ops, 136 119 }; 137 120 138 121 static int netiucv_callback_connreq(struct iucv_path *, u8 *, u8 *); ··· 196 213 fsm_instance *fsm; 197 214 struct iucv_connection *conn; 198 215 struct device *dev; 199 - int pm_state; 200 216 }; 201 217 202 218 /** ··· 1257 1275 return 0; 1258 1276 } 1259 1277 1260 - static int netiucv_pm_prepare(struct device *dev) 1261 - { 1262 - IUCV_DBF_TEXT(trace, 3, __func__); 1263 - return 0; 1264 - } 1265 - 1266 - static void netiucv_pm_complete(struct device *dev) 1267 - { 1268 - IUCV_DBF_TEXT(trace, 3, __func__); 1269 - return; 1270 - } 1271 - 1272 - /** 1273 - * netiucv_pm_freeze() - Freeze PM callback 1274 - * @dev: netiucv device 1275 - * 1276 - * close open netiucv interfaces 1277 - */ 1278 - static int netiucv_pm_freeze(struct device *dev) 1279 - { 1280 - struct netiucv_priv *priv = dev_get_drvdata(dev); 1281 - struct net_device *ndev = NULL; 1282 - int rc = 0; 1283 - 1284 - IUCV_DBF_TEXT(trace, 3, __func__); 1285 - if (priv && priv->conn) 1286 - ndev = priv->conn->netdev; 1287 - if (!ndev) 1288 - goto out; 1289 - netif_device_detach(ndev); 1290 - priv->pm_state = fsm_getstate(priv->fsm); 1291 - rc = netiucv_close(ndev); 1292 - out: 1293 - return rc; 1294 - } 1295 - 1296 - /** 1297 - * netiucv_pm_restore_thaw() - Thaw and restore PM callback 1298 - * @dev: netiucv device 1299 - * 1300 - * re-open netiucv interfaces closed during freeze 1301 - */ 1302 - static int netiucv_pm_restore_thaw(struct device *dev) 1303 - { 1304 - struct netiucv_priv *priv = dev_get_drvdata(dev); 1305 - struct net_device *ndev = NULL; 1306 - int rc = 0; 1307 - 1308 - IUCV_DBF_TEXT(trace, 3, __func__); 1309 - if (priv && priv->conn) 1310 - ndev = priv->conn->netdev; 1311 - if (!ndev) 1312 - goto out; 1313 - switch (priv->pm_state) { 1314 - case DEV_STATE_RUNNING: 1315 - case DEV_STATE_STARTWAIT: 1316 - rc = netiucv_open(ndev); 1317 - break; 1318 - default: 1319 - break; 1320 - } 1321 - netif_device_attach(ndev); 1322 - out: 1323 - return rc; 1324 - } 1325 - 1326 1278 /** 1327 1279 * Start transmission of a packet. 1328 1280 * Called from generic network device layer. ··· 2072 2156 netiucv_unregister_device(dev); 2073 2157 } 2074 2158 2075 - device_unregister(netiucv_dev); 2076 2159 driver_unregister(&netiucv_driver); 2077 2160 iucv_unregister(&netiucv_handler, 1); 2078 2161 iucv_unregister_dbf_views(); ··· 2097 2182 IUCV_DBF_TEXT_(setup, 2, "ret %d from driver_register\n", rc); 2098 2183 goto out_iucv; 2099 2184 } 2100 - /* establish dummy device */ 2101 - netiucv_dev = kzalloc(sizeof(struct device), GFP_KERNEL); 2102 - if (!netiucv_dev) { 2103 - rc = -ENOMEM; 2104 - goto out_driver; 2105 - } 2106 - dev_set_name(netiucv_dev, "netiucv"); 2107 - netiucv_dev->bus = &iucv_bus; 2108 - netiucv_dev->parent = iucv_root; 2109 - netiucv_dev->release = (void (*)(struct device *))kfree; 2110 - netiucv_dev->driver = &netiucv_driver; 2111 - rc = device_register(netiucv_dev); 2112 - if (rc) { 2113 - put_device(netiucv_dev); 2114 - goto out_driver; 2115 - } 2185 + 2116 2186 netiucv_banner(); 2117 2187 return rc; 2118 2188 2119 - out_driver: 2120 - driver_unregister(&netiucv_driver); 2121 2189 out_iucv: 2122 2190 iucv_unregister(&netiucv_handler, 1); 2123 2191 out_dbf:
-65
drivers/s390/net/smsgiucv.c
··· 29 29 MODULE_DESCRIPTION ("Linux for S/390 IUCV special message driver"); 30 30 31 31 static struct iucv_path *smsg_path; 32 - /* dummy device used as trigger for PM functions */ 33 - static struct device *smsg_dev; 34 32 35 33 static DEFINE_SPINLOCK(smsg_list_lock); 36 34 static LIST_HEAD(smsg_list); 37 - static int iucv_path_connected; 38 35 39 36 static int smsg_path_pending(struct iucv_path *, u8 *, u8 *); 40 37 static void smsg_message_pending(struct iucv_path *, struct iucv_message *); ··· 121 124 kfree(cb); 122 125 } 123 126 124 - static int smsg_pm_freeze(struct device *dev) 125 - { 126 - #ifdef CONFIG_PM_DEBUG 127 - printk(KERN_WARNING "smsg_pm_freeze\n"); 128 - #endif 129 - if (smsg_path && iucv_path_connected) { 130 - iucv_path_sever(smsg_path, NULL); 131 - iucv_path_connected = 0; 132 - } 133 - return 0; 134 - } 135 - 136 - static int smsg_pm_restore_thaw(struct device *dev) 137 - { 138 - int rc; 139 - 140 - #ifdef CONFIG_PM_DEBUG 141 - printk(KERN_WARNING "smsg_pm_restore_thaw\n"); 142 - #endif 143 - if (smsg_path && !iucv_path_connected) { 144 - memset(smsg_path, 0, sizeof(*smsg_path)); 145 - smsg_path->msglim = 255; 146 - smsg_path->flags = 0; 147 - rc = iucv_path_connect(smsg_path, &smsg_handler, "*MSG ", 148 - NULL, NULL, NULL); 149 - #ifdef CONFIG_PM_DEBUG 150 - if (rc) 151 - printk(KERN_ERR 152 - "iucv_path_connect returned with rc %i\n", rc); 153 - #endif 154 - if (!rc) 155 - iucv_path_connected = 1; 156 - cpcmd("SET SMSG IUCV", NULL, 0, NULL); 157 - } 158 - return 0; 159 - } 160 - 161 - static const struct dev_pm_ops smsg_pm_ops = { 162 - .freeze = smsg_pm_freeze, 163 - .thaw = smsg_pm_restore_thaw, 164 - .restore = smsg_pm_restore_thaw, 165 - }; 166 - 167 127 static struct device_driver smsg_driver = { 168 128 .owner = THIS_MODULE, 169 129 .name = SMSGIUCV_DRV_NAME, 170 130 .bus = &iucv_bus, 171 - .pm = &smsg_pm_ops, 172 131 }; 173 132 174 133 static void __exit smsg_exit(void) 175 134 { 176 135 cpcmd("SET SMSG OFF", NULL, 0, NULL); 177 - device_unregister(smsg_dev); 178 136 iucv_unregister(&smsg_handler, 1); 179 137 driver_unregister(&smsg_driver); 180 138 } ··· 157 205 NULL, NULL, NULL); 158 206 if (rc) 159 207 goto out_free_path; 160 - else 161 - iucv_path_connected = 1; 162 - smsg_dev = kzalloc(sizeof(struct device), GFP_KERNEL); 163 - if (!smsg_dev) { 164 - rc = -ENOMEM; 165 - goto out_free_path; 166 - } 167 - dev_set_name(smsg_dev, "smsg_iucv"); 168 - smsg_dev->bus = &iucv_bus; 169 - smsg_dev->parent = iucv_root; 170 - smsg_dev->release = (void (*)(struct device *))kfree; 171 - smsg_dev->driver = &smsg_driver; 172 - rc = device_register(smsg_dev); 173 - if (rc) 174 - goto out_put; 175 208 176 209 cpcmd("SET SMSG IUCV", NULL, 0, NULL); 177 210 return 0; 178 211 179 - out_put: 180 - put_device(smsg_dev); 181 212 out_free_path: 182 213 iucv_path_free(smsg_path); 183 214 smsg_path = NULL;