Re: [PATCH anybus v4 1/7] fieldbus_dev: add Fieldbus Device subsystem.

2018-11-28 Thread Sven Van Asbroeck
On Wed, Nov 28, 2018 at 1:36 PM Greg KH wrote: > So you still need a char device, and you will have have a load of them, > just use the misc device api. It's simple, clean, and is hard to get > wrong. The cdev api is hard, complex, and trivial to get wrong in any > number of different ways

Re: [PATCH anybus v4 1/7] fieldbus_dev: add Fieldbus Device subsystem.

2018-11-28 Thread Sven Van Asbroeck
On Wed, Nov 28, 2018 at 1:36 PM Greg KH wrote: > So you still need a char device, and you will have have a load of them, > just use the misc device api. It's simple, clean, and is hard to get > wrong. The cdev api is hard, complex, and trivial to get wrong in any > number of different ways

Re: [PATCH anybus v4 1/7] fieldbus_dev: add Fieldbus Device subsystem.

2018-11-28 Thread Greg KH
On Wed, Nov 28, 2018 at 01:19:05PM -0500, Sven Van Asbroeck wrote: > On Wed, Nov 28, 2018 at 12:42 PM Greg KH wrote: > > > It depends on what you want to do with this device node. You can use a > > static one in your structure if you use it to "cast back" to your real > > structure in the

Re: [PATCH anybus v4 1/7] fieldbus_dev: add Fieldbus Device subsystem.

2018-11-28 Thread Greg KH
On Wed, Nov 28, 2018 at 01:19:05PM -0500, Sven Van Asbroeck wrote: > On Wed, Nov 28, 2018 at 12:42 PM Greg KH wrote: > > > It depends on what you want to do with this device node. You can use a > > static one in your structure if you use it to "cast back" to your real > > structure in the

Re: [PATCH anybus v4 1/7] fieldbus_dev: add Fieldbus Device subsystem.

2018-11-28 Thread Sven Van Asbroeck
On Wed, Nov 28, 2018 at 12:42 PM Greg KH wrote: > It depends on what you want to do with this device node. You can use a > static one in your structure if you use it to "cast back" to your real > structure in the open() call, do you do that? I do... static int fieldbus_open(struct inode

Re: [PATCH anybus v4 1/7] fieldbus_dev: add Fieldbus Device subsystem.

2018-11-28 Thread Sven Van Asbroeck
On Wed, Nov 28, 2018 at 12:42 PM Greg KH wrote: > It depends on what you want to do with this device node. You can use a > static one in your structure if you use it to "cast back" to your real > structure in the open() call, do you do that? I do... static int fieldbus_open(struct inode

Re: [PATCH anybus v4 1/7] fieldbus_dev: add Fieldbus Device subsystem.

2018-11-28 Thread Greg KH
On Wed, Nov 28, 2018 at 10:39:41AM -0500, Sven Van Asbroeck wrote: > Wow Greg, thanks for the review, this is awesome !! > > On Tue, Nov 27, 2018 at 2:54 AM Greg KH wrote: > > >> + cdev_init(>cdev, _fops); > >> + err = cdev_add(>cdev, devno, 1); > >> + if (err) { > >> +

Re: [PATCH anybus v4 1/7] fieldbus_dev: add Fieldbus Device subsystem.

2018-11-28 Thread Greg KH
On Wed, Nov 28, 2018 at 10:39:41AM -0500, Sven Van Asbroeck wrote: > Wow Greg, thanks for the review, this is awesome !! > > On Tue, Nov 27, 2018 at 2:54 AM Greg KH wrote: > > >> + cdev_init(>cdev, _fops); > >> + err = cdev_add(>cdev, devno, 1); > >> + if (err) { > >> +

Re: [PATCH anybus v4 1/7] fieldbus_dev: add Fieldbus Device subsystem.

2018-11-28 Thread Sven Van Asbroeck
Wow Greg, thanks for the review, this is awesome !! On Tue, Nov 27, 2018 at 2:54 AM Greg KH wrote: >> + cdev_init(>cdev, _fops); >> + err = cdev_add(>cdev, devno, 1); >> + if (err) { >> + pr_err("fieldbus_dev%d unable to add device %d:%d\n", >> +

Re: [PATCH anybus v4 1/7] fieldbus_dev: add Fieldbus Device subsystem.

2018-11-28 Thread Sven Van Asbroeck
Wow Greg, thanks for the review, this is awesome !! On Tue, Nov 27, 2018 at 2:54 AM Greg KH wrote: >> + cdev_init(>cdev, _fops); >> + err = cdev_add(>cdev, devno, 1); >> + if (err) { >> + pr_err("fieldbus_dev%d unable to add device %d:%d\n", >> +

Re: [PATCH anybus v4 1/7] fieldbus_dev: add Fieldbus Device subsystem.

2018-11-26 Thread Greg KH
On Wed, Nov 21, 2018 at 10:07:03AM -0500, thesve...@gmail.com wrote: > +static struct attribute *fieldbus_attrs[] = { > + _attr_enabled.attr, > + _attr_card_name.attr, > + _attr_fieldbus_id.attr, > + _attr_read_area_size.attr, > + _attr_write_area_size.attr, > +

Re: [PATCH anybus v4 1/7] fieldbus_dev: add Fieldbus Device subsystem.

2018-11-26 Thread Greg KH
On Wed, Nov 21, 2018 at 10:07:03AM -0500, thesve...@gmail.com wrote: > +static struct attribute *fieldbus_attrs[] = { > + _attr_enabled.attr, > + _attr_card_name.attr, > + _attr_fieldbus_id.attr, > + _attr_read_area_size.attr, > + _attr_write_area_size.attr, > +

Re: [PATCH anybus v4 1/7] fieldbus_dev: add Fieldbus Device subsystem.

2018-11-26 Thread Greg KH
On Wed, Nov 21, 2018 at 10:07:03AM -0500, thesve...@gmail.com wrote: > Fieldbus device (client) adapters allow data exchange with a PLC aka. > "Fieldbus Controller" over a fieldbus (Profinet, FLNet, etc.) > > They are typically used when a Linux device wants to expose itself > as an actuator,

Re: [PATCH anybus v4 1/7] fieldbus_dev: add Fieldbus Device subsystem.

2018-11-26 Thread Greg KH
On Wed, Nov 21, 2018 at 10:07:03AM -0500, thesve...@gmail.com wrote: > Fieldbus device (client) adapters allow data exchange with a PLC aka. > "Fieldbus Controller" over a fieldbus (Profinet, FLNet, etc.) > > They are typically used when a Linux device wants to expose itself > as an actuator,

Re: [PATCH anybus v4 1/7] fieldbus_dev: add Fieldbus Device subsystem.

2018-11-26 Thread Greg KH
On Wed, Nov 21, 2018 at 10:07:03AM -0500, thesve...@gmail.com wrote: > Fieldbus device (client) adapters allow data exchange with a PLC aka. > "Fieldbus Controller" over a fieldbus (Profinet, FLNet, etc.) > > They are typically used when a Linux device wants to expose itself > as an actuator,

Re: [PATCH anybus v4 1/7] fieldbus_dev: add Fieldbus Device subsystem.

2018-11-26 Thread Greg KH
On Wed, Nov 21, 2018 at 10:07:03AM -0500, thesve...@gmail.com wrote: > Fieldbus device (client) adapters allow data exchange with a PLC aka. > "Fieldbus Controller" over a fieldbus (Profinet, FLNet, etc.) > > They are typically used when a Linux device wants to expose itself > as an actuator,