misc: c2port: Calculate bin_attribute size through group callback
Modifying the size of the global bin_attribute instance can be racy.
Instead use the new .bin_size callback to do so safely.
For this to work move the initialization of c2dev->ops before the call
to device_create() as the size callback will need access to it.
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Link: https://lore.kernel.org/r/20241221-sysfs-const-bin_attr-misc-drivers-v2-4-ba5e79fe8771@weissschuh.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>