[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170331141009.GA8141@kroah.com>
Date: Fri, 31 Mar 2017 16:10:09 +0200
From: Greg KH <greg@...ah.com>
To: Wu Hao <hao.wu@...el.com>
Cc: atull@...nel.org, moritz.fischer@...us.com,
linux-fpga@...r.kernel.org, linux-kernel@...r.kernel.org,
luwei.kang@...el.com, yi.z.zhang@...el.com,
tim.whisonant@...el.com, Enno Luebbers <enno.luebbers@...el.com>,
Shiva Rao <shiva.rao@...el.com>,
Christopher Rauer <christopher.rauer@...el.com>,
guangrong.xiao@...ux.intel.com
Subject: Re: [PATCH 02/16] fpga: add FPGA device framework
On Fri, Mar 31, 2017 at 09:31:09PM +0800, Wu Hao wrote:
> > On Thu, Mar 30, 2017 at 08:08:02PM +0800, Wu Hao wrote:
> > > +#include <linux/device.h>
> > > +#include <linux/module.h>
> > > +#include <linux/slab.h>
> > > +#include <linux/fpga/fpga-dev.h>
> > > +
> > > +static DEFINE_IDA(fpga_dev_ida);
> > > +static struct class *fpga_dev_class;
> > > +
> > > +static ssize_t name_show(struct device *dev,
> > > + struct device_attribute *attr, char *buf) {
> > > + struct fpga_dev *fdev = to_fpga_dev(dev);
> > > +
> > > + return sprintf(buf, "%s\n", fdev->name); } static
> > > +DEVICE_ATTR_RO(name);
> >
> > There already is a name for the device, it's the directory name.
>
> For current implementation, the directory will have a common name like
>
> /sys/class/fpga/fpga.0
> /sys/class/fpga/fpga.1
> /sys/class/fpga/fpga.2
> ...
>
> For the 'name' sysfs interface, driver can put more device specific info
> into this 'name', e.g intel-fpga-dev. Userspace can use this information
> to know which kind of FPGA device it is. e.g if applications read the
> /sys/class/fpga/fpga.5/name as intel-fpga-dev, it means the 5th fpga
> device on the system is a Intel FPGA device, and then application applies
> related method to enumerate the accelerators for it.
> And other existing fpga class has similar sysfs interface too, so I would
> like to keep it aligned with others.
Ok, then document the heck out of this in Documentation/ABI/ which I
don't think you did for the sysfs files you are creating.
thanks,
greg k-h
Powered by blists - more mailing lists