'How to show a device in bus and class?

How show the same struct device in bus and class in sysfs structure? I'm getting an error when doing this. Currently I'm assigning bus and class attributes of struct device before calling device_register. The error message says that a device in /device of the same name already exists.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source