public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jason Wang <jasowang@redhat.com>
To: Jason Gunthorpe <jgg@mellanox.com>
Cc: mst@redhat.com, linux-kernel@vger.kernel.org,
	kvm@vger.kernel.org, virtualization@lists.linux-foundation.org,
	netdev@vger.kernel.org, tiwei.bie@intel.com,
	maxime.coquelin@redhat.com, cunming.liang@intel.com,
	zhihong.wang@intel.com, rob.miller@broadcom.com,
	xiao.w.wang@intel.com, haotian.wang@sifive.com,
	lingshan.zhu@intel.com, eperezma@redhat.com, lulu@redhat.com,
	parav@mellanox.com, kevin.tian@intel.com, stefanha@redhat.com,
	rdunlap@infradead.org, hch@infradead.org, aadam@redhat.com,
	jiri@mellanox.com, shahafs@mellanox.com, hanand@xilinx.com,
	mhabets@solarflare.com, gdawar@xilinx.com, saugatm@xilinx.com,
	vmireyno@marvell.com
Subject: Re: [PATCH V5 3/5] vDPA: introduce vDPA bus
Date: Thu, 5 Mar 2020 11:01:43 +0800	[thread overview]
Message-ID: <2842e634-bb92-a901-0a64-35a4dcde22da@redhat.com> (raw)
In-Reply-To: <20200304192949.GR26318@mellanox.com>


On 2020/3/5 上午3:29, Jason Gunthorpe wrote:
> On Wed, Feb 26, 2020 at 02:04:54PM +0800, Jason Wang wrote:
>> +struct vdpa_device *vdpa_alloc_device(struct device *parent,
>> +				      struct device *dma_dev,
>> +				      const struct vdpa_config_ops *config)
>> +{
>> +	struct vdpa_device *vdev;
>> +	int err = -ENOMEM;
>> +
>> +	if (!parent || !dma_dev || !config)
>> +		goto err;
>> +
>> +	vdev = kzalloc(sizeof(*vdev), GFP_KERNEL);
>> +	if (!vdev)
>> +		goto err;
>> +
>> +	err = ida_simple_get(&vdpa_index_ida, 0, 0, GFP_KERNEL);
>> +	if (err < 0)
>> +		goto err_ida;
>> +
>> +	vdev->dev.bus = &vdpa_bus;
>> +	vdev->dev.parent = parent;
>> +	vdev->dev.release = vdpa_release_dev;
>> +
>> +	device_initialize(&vdev->dev);
>> +
>> +	vdev->index = err;
>> +	vdev->dma_dev = dma_dev;
>> +	vdev->config = config;
>> +
>> +	dev_set_name(&vdev->dev, "vdpa%u", vdev->index);
> Probably shouldn't ignore the error for dev_set_name ?
>
> err = dev_set_name()
> if (err) {
>     put_device(&vdev->dev);
>     return ERR_PTR(err);
> }
>
> Jason
>

Right, will fix.

Thanks


  reply	other threads:[~2020-03-05  3:02 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-26  6:04 [PATCH V5 0/5] vDPA support Jason Wang
2020-02-26  6:04 ` [PATCH V5 1/5] vhost: factor out IOTLB Jason Wang
2020-02-26  6:04 ` [PATCH V5 2/5] vringh: IOTLB support Jason Wang
2020-02-26  6:04 ` [PATCH V5 3/5] vDPA: introduce vDPA bus Jason Wang
2020-03-04 19:29   ` Jason Gunthorpe
2020-03-05  3:01     ` Jason Wang [this message]
2020-02-26  6:04 ` [PATCH V5 4/5] virtio: introduce a vDPA based transport Jason Wang
2020-02-26  6:04 ` [PATCH V5 5/5] vdpasim: vDPA device simulator Jason Wang
2020-02-26 23:55   ` kbuild test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2842e634-bb92-a901-0a64-35a4dcde22da@redhat.com \
    --to=jasowang@redhat.com \
    --cc=aadam@redhat.com \
    --cc=cunming.liang@intel.com \
    --cc=eperezma@redhat.com \
    --cc=gdawar@xilinx.com \
    --cc=hanand@xilinx.com \
    --cc=haotian.wang@sifive.com \
    --cc=hch@infradead.org \
    --cc=jgg@mellanox.com \
    --cc=jiri@mellanox.com \
    --cc=kevin.tian@intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=lingshan.zhu@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lulu@redhat.com \
    --cc=maxime.coquelin@redhat.com \
    --cc=mhabets@solarflare.com \
    --cc=mst@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=parav@mellanox.com \
    --cc=rdunlap@infradead.org \
    --cc=rob.miller@broadcom.com \
    --cc=saugatm@xilinx.com \
    --cc=shahafs@mellanox.com \
    --cc=stefanha@redhat.com \
    --cc=tiwei.bie@intel.com \
    --cc=virtualization@lists.linux-foundation.org \
    --cc=vmireyno@marvell.com \
    --cc=xiao.w.wang@intel.com \
    --cc=zhihong.wang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox