From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751910AbdDALlD (ORCPT ); Sat, 1 Apr 2017 07:41:03 -0400 Received: from mga09.intel.com ([134.134.136.24]:12211 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751346AbdDALlB (ORCPT ); Sat, 1 Apr 2017 07:41:01 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,257,1486454400"; d="scan'208";a="67744796" Date: Sat, 1 Apr 2017 19:36:23 +0800 From: Wu Hao To: Greg KH Cc: atull@kernel.org, moritz.fischer@ettus.com, linux-fpga@vger.kernel.org, linux-kernel@vger.kernel.org, luwei.kang@intel.com, yi.z.zhang@intel.com, tim.whisonant@intel.com, Enno Luebbers , Shiva Rao , Christopher Rauer , guangrong.xiao@linux.intel.com Subject: Re: [PATCH 02/16] fpga: add FPGA device framework Message-ID: <20170401113623.GD4804@hao-dev> References: <1490875696-15145-1-git-send-email-hao.wu@intel.com> <1490875696-15145-3-git-send-email-hao.wu@intel.com> <20170331061322.GB7621@kroah.com> <82D7661F83C1A047AF7DC287873BF1E167C90F1B@SHSMSX101.ccr.corp.intel.com> <20170331133109.GB1312@hao-dev> <20170331141009.GA8141@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170331141009.GA8141@kroah.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 31, 2017 at 04:10:09PM +0200, Greg KH wrote: > 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 > > > > +#include > > > > +#include > > > > +#include > > > > + > > > > +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. Sure, thanks a lot for the reminder. I will prepare the sysfs docs in the next version. Thanks Hao > > thanks, > > greg k-h > -- > To unsubscribe from this list: send the line "unsubscribe linux-fpga" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html