Re: [mm Patch] isdn4linux: Gigaset driver: fix __must_check warning

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 11.07.2006 23:51, Andrew Morton wrote:

> Tilman Schmidt <[email protected]> wrote:
> 
>>-	class_device_create_file(cs->class, &class_device_attr_cidmode);
>>+	if (class_device_create_file(cs->class, &class_device_attr_cidmode))
>>+		dev_warn(cs->dev, "could not create sysfs attribute\n");
> 
> With this change we'll emit a warning (actually it's an error - I'll make
> it dev_err(), OK?)

Fine with me. It's not fatal to the driver which is quite capable of
operating without that sysfs file, but ok, it *is* an error, and in
fact, if class_device_create_file() fails there must be something
seriously wrong.

> and then we'll continue execution, pretending that the
> sysfs file actually got registered.  Later, we'll try to unregister a
> not-registered sysfs file.

Well, from my reading of the source, class_device_remove_file() should
be able to cope with that. The alternative would be to save off the
fact that the original creation failed somewhere in the driver data,
for the sole purpose of avoiding calling class_device_remove_file()
for it later.

-- 
Tilman Schmidt                          E-Mail: [email protected]
Bonn, Germany
Diese Nachricht besteht zu 100% aus wiederverwerteten Bits.
Ungeöffnet mindestens haltbar bis: (siehe Rückseite)

Attachment: signature.asc
Description: OpenPGP digital signature


[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux