i2c: Do not use device name after device_unregister

dev_dbg outputs dev_name, which is released with device_unregister. This bug
resulted in output like this:

i2c Xy2�0: adapter [SMBus I801 adapter at 1880] unregistered

The right output would be:
i2c i2c-0: adapter [SMBus I801 adapter at 1880] unregistered

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>

authored by Thadeu Lima de Souza Cascardo and committed by Jean Delvare c5567521 22f8b269

+3 -2
+3 -2
drivers/i2c/i2c-core.c
··· 843 adap->dev.parent); 844 #endif 845 846 /* clean up the sysfs representation */ 847 init_completion(&adap->dev_released); 848 device_unregister(&adap->dev); ··· 857 mutex_lock(&core_lock); 858 idr_remove(&i2c_adapter_idr, adap->nr); 859 mutex_unlock(&core_lock); 860 - 861 - dev_dbg(&adap->dev, "adapter [%s] unregistered\n", adap->name); 862 863 /* Clear the device structure in case this adapter is ever going to be 864 added again */
··· 843 adap->dev.parent); 844 #endif 845 846 + /* device name is gone after device_unregister */ 847 + dev_dbg(&adap->dev, "adapter [%s] unregistered\n", adap->name); 848 + 849 /* clean up the sysfs representation */ 850 init_completion(&adap->dev_released); 851 device_unregister(&adap->dev); ··· 854 mutex_lock(&core_lock); 855 idr_remove(&i2c_adapter_idr, adap->nr); 856 mutex_unlock(&core_lock); 857 858 /* Clear the device structure in case this adapter is ever going to be 859 added again */