Lines 170-179
Link Here
|
170 |
errno = EINVAL; |
170 |
errno = EINVAL; |
171 |
return NULL; |
171 |
return NULL; |
172 |
} |
172 |
} |
173 |
if (sysfs_path_is_dir(path)) { |
|
|
174 |
dprintf("Incorrect path to device: %s\n", path); |
175 |
return NULL; |
176 |
} |
177 |
dev = alloc_device(); |
173 |
dev = alloc_device(); |
178 |
if (!dev) { |
174 |
if (!dev) { |
179 |
dprintf("Error allocating device at %s\n", path); |
175 |
dprintf("Error allocating device at %s\n", path); |
Lines 197-205
Link Here
|
197 |
* implies that the dev->name and dev->bus_id contain same data. |
193 |
* implies that the dev->name and dev->bus_id contain same data. |
198 |
*/ |
194 |
*/ |
199 |
safestrcpy(dev->name, dev->bus_id); |
195 |
safestrcpy(dev->name, dev->bus_id); |
200 |
|
196 |
safestrcpy(dev->bus, dev->bus_id); |
201 |
if (sysfs_get_device_bus(dev)) |
|
|
202 |
dprintf("Could not get device bus\n"); |
203 |
|
197 |
|
204 |
if (get_dev_driver(dev)) { |
198 |
if (get_dev_driver(dev)) { |
205 |
dprintf("Could not get device %s's driver\n", dev->bus_id); |
199 |
dprintf("Could not get device %s's driver\n", dev->bus_id); |