[PATCH linux dev-4.7 1/2] drivers: fsi: delete device on unscan

Eddie James eajames at linux.vnet.ibm.com
Tue Feb 14 15:11:51 AEDT 2017



On 02/13/2017 06:18 PM, Joel Stanley wrote:
> On Tue, Feb 14, 2017 at 6:37 AM, Eddie James <eajames at linux.vnet.ibm.com> wrote:
>> From: "Edward A. James" <eajames at us.ibm.com>
>>
>> need to delete device so that client driver "remove" is called.
>>
>> Signed-off-by: Edward A. James <eajames at us.ibm.com>
>> ---
>>   drivers/fsi/fsi-core.c | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/fsi/fsi-core.c b/drivers/fsi/fsi-core.c
>> index 1e9c5a2..e8a3618 100644
>> --- a/drivers/fsi/fsi-core.c
>> +++ b/drivers/fsi/fsi-core.c
>> @@ -512,6 +512,7 @@ static void fsi_master_unscan(struct fsi_master *master)
>>                  list_for_each_entry_safe(fsi_dev, fsi_dev_tmp,
>>                                          &slave->my_engines, link) {
>>                          list_del(&fsi_dev->link);
>> +                       device_del(&fsi_dev->dev);
>>                          put_device(&fsi_dev->dev);
> put_device calls kobject_put, but device_del has already called
> kobject_del. Are you sure this is what you want to do here?

Hmm, I was just doing what device_unregister() does. We manually call 
device_add() for these devices, so I understand from the documentation 
that device_del() should be called, but I think device_unregister would 
work as well. I can confirm this works and doesn't throw any warnings 
after repeated fsi scans.

>
>
>>                  }
>>                  device_unregister(&slave->dev);
>> --
>> 1.8.3.1
>>



More information about the openbmc mailing list