sysfs: fix for thinko with sysfs_bin_attr_init()

After merging the final tree, today's linux-next build (powerpc
allyesconfig) failed like this:

drivers/pci/pci-sysfs.c: In function 'pci_create_legacy_files':
drivers/pci/pci-sysfs.c:645: error: lvalue required as unary '&' operand
drivers/pci/pci-sysfs.c:658: error: lvalue required as unary '&' operand

Caused by commit "sysfs: Use sysfs_attr_init and sysfs_bin_attr_init on
dynamic attributes" interacting with commit "sysfs: Use one lockdep
class per sysfs attribute") both from the driver-core tree.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>


authored by Stephen Rothwell and committed by Greg Kroah-Hartman 62e877b8 0f4288ec

+3 -3
+2 -2
drivers/pci/pci-sysfs.c
··· 642 642 if (!b->legacy_io) 643 643 goto kzalloc_err; 644 644 645 - sysfs_bin_attr_init(&b->legacy_io); 645 + sysfs_bin_attr_init(b->legacy_io); 646 646 b->legacy_io->attr.name = "legacy_io"; 647 647 b->legacy_io->size = 0xffff; 648 648 b->legacy_io->attr.mode = S_IRUSR | S_IWUSR; ··· 655 655 goto legacy_io_err; 656 656 657 657 /* Allocated above after the legacy_io struct */ 658 - sysfs_bin_attr_init(&b->legacy_mem); 658 + sysfs_bin_attr_init(b->legacy_mem); 659 659 b->legacy_mem = b->legacy_io + 1; 660 660 b->legacy_mem->attr.name = "legacy_mem"; 661 661 b->legacy_mem->size = 1024*1024;
+1 -1
include/linux/sysfs.h
··· 110 110 * enabled. Lockdep gives a nice error when your attribute is 111 111 * added to sysfs if you don't have this. 112 112 */ 113 - #define sysfs_bin_attr_init(bin_attr) sysfs_attr_init(&bin_attr->attr) 113 + #define sysfs_bin_attr_init(bin_attr) sysfs_attr_init(&(bin_attr)->attr) 114 114 115 115 struct sysfs_ops { 116 116 ssize_t (*show)(struct kobject *, struct attribute *,char *);