greybus: interface: Add print messages on interface initialization/removal
authorViresh Kumar <viresh.kumar@linaro.org>
Fri, 19 Feb 2016 10:27:46 +0000 (15:57 +0530)
committerGreg Kroah-Hartman <gregkh@google.com>
Tue, 23 Feb 2016 00:25:11 +0000 (16:25 -0800)
commit907d1e16ffe4ea50a9bdf1c644fd48ce6a126e4f
tree5b3241bede8a8dd86ae26fceec2f71a40018abeb
parent2422d36696f36ea92f17bb34a129a74f9b173891
greybus: interface: Add print messages on interface initialization/removal

It might be of interest (to developers at least) to know when an
interface is getting created or removed from the system.

Interface creation message can further contain basic information about
the interface, like its vid/pid and mfg/prod ids.

Now, the interface is created by gb_interface_create(), which doesn't
register the intf->dev to the kernel and so the print message is rather
added to gb_interface_init() where we register the device with the
kernel.

A similar message is added to gb_interface_remove() only when the
interface was earlier initialized.

And this is how the output looks on real insertion/removal of the
module:

greybus 1-1: Interface added: VID=0x00000001, PID=0x00000001
greybus 1-1: DDBL1 Manufacturer=0x00000001, Product=0x00000001
...
greybus 1-1: Interface removed

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Reviewed-by: Johan Hovold <johan@hovoldconsulting.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
drivers/staging/greybus/interface.c