core.c (ee0736627d3347be0be2769fa7b26431f9726c9d) | core.c (5c8563d773c0e9f0ac2a552e84806decd98ce732) |
---|---|
1/* 2 * drivers/base/core.c - core driver model code (device registration, etc) 3 * 4 * Copyright (c) 2002-3 Patrick Mochel 5 * Copyright (c) 2002-3 Open Source Development Labs 6 * Copyright (c) 2006 Greg Kroah-Hartman <gregkh@suse.de> 7 * Copyright (c) 2006 Novell, Inc. 8 * --- 865 unchanged lines hidden (view full) --- 874 * the name, and force the use of dev_name() 875 */ 876 if (dev->init_name) { 877 dev_set_name(dev, dev->init_name); 878 dev->init_name = NULL; 879 } 880 881 if (!dev_name(dev)) | 1/* 2 * drivers/base/core.c - core driver model code (device registration, etc) 3 * 4 * Copyright (c) 2002-3 Patrick Mochel 5 * Copyright (c) 2002-3 Open Source Development Labs 6 * Copyright (c) 2006 Greg Kroah-Hartman <gregkh@suse.de> 7 * Copyright (c) 2006 Novell, Inc. 8 * --- 865 unchanged lines hidden (view full) --- 874 * the name, and force the use of dev_name() 875 */ 876 if (dev->init_name) { 877 dev_set_name(dev, dev->init_name); 878 dev->init_name = NULL; 879 } 880 881 if (!dev_name(dev)) |
882 goto done; | 882 goto name_error; |
883 884 pr_debug("device: '%s': %s\n", dev_name(dev), __func__); 885 886 parent = get_device(dev->parent); 887 setup_parent(dev, parent); 888 889 /* use parent numa_node */ 890 if (parent) --- 82 unchanged lines hidden (view full) --- 973 device_remove_file(dev, &uevent_attr); 974 attrError: 975 kobject_uevent(&dev->kobj, KOBJ_REMOVE); 976 kobject_del(&dev->kobj); 977 Error: 978 cleanup_device_parent(dev); 979 if (parent) 980 put_device(parent); | 883 884 pr_debug("device: '%s': %s\n", dev_name(dev), __func__); 885 886 parent = get_device(dev->parent); 887 setup_parent(dev, parent); 888 889 /* use parent numa_node */ 890 if (parent) --- 82 unchanged lines hidden (view full) --- 973 device_remove_file(dev, &uevent_attr); 974 attrError: 975 kobject_uevent(&dev->kobj, KOBJ_REMOVE); 976 kobject_del(&dev->kobj); 977 Error: 978 cleanup_device_parent(dev); 979 if (parent) 980 put_device(parent); |
981name_error: 982 kfree(dev->p); 983 dev->p = NULL; |
|
981 goto done; 982} 983 984/** 985 * device_register - register a device with the system. 986 * @dev: pointer to the device structure 987 * 988 * This happens in two clean steps - initialize the device --- 677 unchanged lines hidden --- | 984 goto done; 985} 986 987/** 988 * device_register - register a device with the system. 989 * @dev: pointer to the device structure 990 * 991 * This happens in two clean steps - initialize the device --- 677 unchanged lines hidden --- |