Displaying 20 results from an estimated 81 matches for "class_create".
2020 Feb 19
1
[PATCH] vhost: introduce vDPA based backend
...int r;
> > > +
> > > + idr_init(&vhost_vdpa.idr);
> > > + mutex_init(&vhost_vdpa.mutex);
> > > + init_waitqueue_head(&vhost_vdpa.release_q);
> > > +
> > > + /* /dev/vhost-vdpa/$vdpa_device_index */
> > > + vhost_vdpa.class = class_create(THIS_MODULE, "vhost-vdpa");
> > > + if (IS_ERR(vhost_vdpa.class)) {
> > > + r = PTR_ERR(vhost_vdpa.class);
> > > + goto err_class;
> > > + }
> > > +
> > > + vhost_vdpa.class->devnode = vhost_vdpa_devnode;
> > > +
> >...
2020 Feb 18
2
[PATCH] vhost: introduce vDPA based backend
..._rcu ..
> +static int __init vhost_vdpa_init(void)
> +{
> + int r;
> +
> + idr_init(&vhost_vdpa.idr);
> + mutex_init(&vhost_vdpa.mutex);
> + init_waitqueue_head(&vhost_vdpa.release_q);
> +
> + /* /dev/vhost-vdpa/$vdpa_device_index */
> + vhost_vdpa.class = class_create(THIS_MODULE, "vhost-vdpa");
> + if (IS_ERR(vhost_vdpa.class)) {
> + r = PTR_ERR(vhost_vdpa.class);
> + goto err_class;
> + }
> +
> + vhost_vdpa.class->devnode = vhost_vdpa_devnode;
> +
> + r = alloc_chrdev_region(&vhost_vdpa.devt, 0, MINORMASK + 1,
> +...
2020 Feb 18
2
[PATCH] vhost: introduce vDPA based backend
..._rcu ..
> +static int __init vhost_vdpa_init(void)
> +{
> + int r;
> +
> + idr_init(&vhost_vdpa.idr);
> + mutex_init(&vhost_vdpa.mutex);
> + init_waitqueue_head(&vhost_vdpa.release_q);
> +
> + /* /dev/vhost-vdpa/$vdpa_device_index */
> + vhost_vdpa.class = class_create(THIS_MODULE, "vhost-vdpa");
> + if (IS_ERR(vhost_vdpa.class)) {
> + r = PTR_ERR(vhost_vdpa.class);
> + goto err_class;
> + }
> +
> + vhost_vdpa.class->devnode = vhost_vdpa_devnode;
> +
> + r = alloc_chrdev_region(&vhost_vdpa.devt, 0, MINORMASK + 1,
> +...
2019 Jun 13
0
[PATCH 02/22] mm: remove the struct hmm_device infrastructure
...mm_device)
-{
- put_device(&hmm_device->device);
-}
-EXPORT_SYMBOL(hmm_device_put);
-
-static int __init hmm_init(void)
-{
- int ret;
-
- ret = alloc_chrdev_region(&hmm_device_devt, 0,
- HMM_DEVICE_MAX,
- "hmm_device");
- if (ret)
- return ret;
-
- hmm_device_class = class_create(THIS_MODULE, "hmm_device");
- if (IS_ERR(hmm_device_class)) {
- unregister_chrdev_region(hmm_device_devt, HMM_DEVICE_MAX);
- return PTR_ERR(hmm_device_class);
- }
- return 0;
-}
-
-device_initcall(hmm_init);
#endif /* CONFIG_DEVICE_PRIVATE || CONFIG_DEVICE_PUBLIC */
--
2.20.1
2020 Feb 19
0
[PATCH] vhost: introduce vDPA based backend
...nit(void)
> > +{
> > + int r;
> > +
> > + idr_init(&vhost_vdpa.idr);
> > + mutex_init(&vhost_vdpa.mutex);
> > + init_waitqueue_head(&vhost_vdpa.release_q);
> > +
> > + /* /dev/vhost-vdpa/$vdpa_device_index */
> > + vhost_vdpa.class = class_create(THIS_MODULE, "vhost-vdpa");
> > + if (IS_ERR(vhost_vdpa.class)) {
> > + r = PTR_ERR(vhost_vdpa.class);
> > + goto err_class;
> > + }
> > +
> > + vhost_vdpa.class->devnode = vhost_vdpa_devnode;
> > +
> > + r = alloc_chrdev_region(&vh...
2013 Sep 05
0
[PATCH RESEND v3 1/7] Intel MIC Host Driver for X100 family.
...robe = mic_probe,
+ .remove = mic_remove
+};
+
+static int __init mic_init(void)
+{
+ int ret;
+
+ ret = alloc_chrdev_region(&g_mic_devno, 0,
+ MIC_MAX_NUM_DEVS, mic_driver_name);
+ if (ret) {
+ pr_err("alloc_chrdev_region failed ret %d\n", ret);
+ goto error;
+ }
+
+ g_mic_class = class_create(THIS_MODULE, mic_driver_name);
+ if (IS_ERR(g_mic_class)) {
+ ret = PTR_ERR(g_mic_class);
+ pr_err("class_create failed ret %d\n", ret);
+ goto cleanup_chrdev;
+ }
+
+ ida_init(&g_mic_ida);
+ ret = pci_register_driver(&mic_driver);
+ if (ret) {
+ pr_err("pci_register_driv...
2013 Aug 08
0
[PATCH v2 1/7] Intel MIC Host Driver for X100 family.
...mic_probe,
+ .remove = mic_remove
+};
+
+static int __init mic_init(void)
+{
+ int ret;
+
+ ret = alloc_chrdev_region(&g_mic.mdev_id, 0,
+ MIC_MAX_NUM_DEVS, mic_driver_name);
+ if (ret) {
+ pr_err("alloc_chrdev_region failed ret %d\n", ret);
+ goto error;
+ }
+
+ g_mic.mic_class = class_create(THIS_MODULE, mic_driver_name);
+ if (IS_ERR(g_mic.mic_class)) {
+ ret = PTR_ERR(g_mic.mic_class);
+ pr_err("class_create failed ret %d\n", ret);
+ goto cleanup_chrdev;
+ }
+
+ ret = pci_register_driver(&mic_driver);
+ if (ret) {
+ pr_err("pci_register_driver failed ret %d\n&q...
2013 May 29
0
DAHDI-Linux and DAHDI-Tools 2.7.0-rc1 Now Available
...sysfs channels: dahdi-sysfs-chan.c
sysfs channels: refactor compat macros
sysfs: add 'lineconfig' attribute to span
dahdi: build fix for Kernels < 2.6.16
code cleanup: remove unused debug_printk()
code cleanup - refactor module_printk()
fix class_create() return value test
xpp: FXO: improve ring debounce notice
show Master change to/from core timer
A channel-less span should not crash dahdi
better chan_printk() output
dahdi: style - checkpatch clean dahdi-sysfs.c
xpp: style - remove extra braces
xpp...
2013 May 29
0
DAHDI-Linux and DAHDI-Tools 2.7.0-rc1 Now Available
...sysfs channels: dahdi-sysfs-chan.c
sysfs channels: refactor compat macros
sysfs: add 'lineconfig' attribute to span
dahdi: build fix for Kernels < 2.6.16
code cleanup: remove unused debug_printk()
code cleanup - refactor module_printk()
fix class_create() return value test
xpp: FXO: improve ring debounce notice
show Master change to/from core timer
A channel-less span should not crash dahdi
better chan_printk() output
dahdi: style - checkpatch clean dahdi-sysfs.c
xpp: style - remove extra braces
xpp...
2013 Jun 07
0
DAHDI-Linux and DAHDI-Tools 2.7.0 Now Available
...sysfs channels: dahdi-sysfs-chan.c
sysfs channels: refactor compat macros
sysfs: add 'lineconfig' attribute to span
dahdi: build fix for Kernels < 2.6.16
code cleanup: remove unused debug_printk()
code cleanup - refactor module_printk()
fix class_create() return value test
xpp: FXO: improve ring debounce notice
show Master change to/from core timer
A channel-less span should not crash dahdi
better chan_printk() output
dahdi: style - checkpatch clean dahdi-sysfs.c
xpp: style - remove extra braces
xpp...
2013 Jun 07
0
DAHDI-Linux and DAHDI-Tools 2.7.0 Now Available
...sysfs channels: dahdi-sysfs-chan.c
sysfs channels: refactor compat macros
sysfs: add 'lineconfig' attribute to span
dahdi: build fix for Kernels < 2.6.16
code cleanup: remove unused debug_printk()
code cleanup - refactor module_printk()
fix class_create() return value test
xpp: FXO: improve ring debounce notice
show Master change to/from core timer
A channel-less span should not crash dahdi
better chan_printk() output
dahdi: style - checkpatch clean dahdi-sysfs.c
xpp: style - remove extra braces
xpp...
2019 Sep 10
1
[RFC PATCH 4/4] docs: Sample driver to demonstrate how to implement virtio-mdev framework
...quot;);
> +}
> +
> +static int __init mvnet_dev_init(void)
> +{
> + int ret = 0;
> +
> + pr_info("mvnet_dev: %s\n", __func__);
> +
> + memset(&mvnet_dev, 0, sizeof(mvnet_dev));
> +
> + idr_init(&mvnet_dev.vd_idr);
> +
> + mvnet_dev.vd_class = class_create(THIS_MODULE, MVNET_CLASS_NAME);
> +
> + if (IS_ERR(mvnet_dev.vd_class)) {
> + pr_err("Error: failed to register mvnet_dev class\n");
> + ret = PTR_ERR(mvnet_dev.vd_class);
> + goto failed1;
> + }
> +
> + mvnet_dev.dev.class = mvnet_dev.vd_class;
> + mvnet_dev...
2019 Nov 05
0
[PATCH V8 6/6] docs: sample driver to demonstrate how to implement virtio-mdev framework
...se(struct device *dev)
+{
+ dev_dbg(dev, "mvnet: released\n");
+}
+
+static int __init mvnet_dev_init(void)
+{
+ int ret = 0;
+
+ pr_info("mvnet_dev: %s\n", __func__);
+
+ memset(&mvnet_dev, 0, sizeof(mvnet_dev));
+
+ idr_init(&mvnet_dev.vd_idr);
+
+ mvnet_dev.vd_class = class_create(THIS_MODULE, MVNET_CLASS_NAME);
+
+ if (IS_ERR(mvnet_dev.vd_class)) {
+ pr_err("Error: failed to register mvnet_dev class\n");
+ ret = PTR_ERR(mvnet_dev.vd_class);
+ goto failed1;
+ }
+
+ mvnet_dev.dev.class = mvnet_dev.vd_class;
+ mvnet_dev.dev.release = mvnet_device_release;
+ dev_se...
2019 Sep 10
0
[RFC PATCH 4/4] docs: Sample driver to demonstrate how to implement virtio-mdev framework
...se(struct device *dev)
+{
+ dev_dbg(dev, "mvnet: released\n");
+}
+
+static int __init mvnet_dev_init(void)
+{
+ int ret = 0;
+
+ pr_info("mvnet_dev: %s\n", __func__);
+
+ memset(&mvnet_dev, 0, sizeof(mvnet_dev));
+
+ idr_init(&mvnet_dev.vd_idr);
+
+ mvnet_dev.vd_class = class_create(THIS_MODULE, MVNET_CLASS_NAME);
+
+ if (IS_ERR(mvnet_dev.vd_class)) {
+ pr_err("Error: failed to register mvnet_dev class\n");
+ ret = PTR_ERR(mvnet_dev.vd_class);
+ goto failed1;
+ }
+
+ mvnet_dev.dev.class = mvnet_dev.vd_class;
+ mvnet_dev.dev.release = mvnet_device_release;
+ dev_se...
2019 Oct 30
0
[PATCH V6 6/6] docs: sample driver to demonstrate how to implement virtio-mdev framework
...se(struct device *dev)
+{
+ dev_dbg(dev, "mvnet: released\n");
+}
+
+static int __init mvnet_dev_init(void)
+{
+ int ret = 0;
+
+ pr_info("mvnet_dev: %s\n", __func__);
+
+ memset(&mvnet_dev, 0, sizeof(mvnet_dev));
+
+ idr_init(&mvnet_dev.vd_idr);
+
+ mvnet_dev.vd_class = class_create(THIS_MODULE, MVNET_CLASS_NAME);
+
+ if (IS_ERR(mvnet_dev.vd_class)) {
+ pr_err("Error: failed to register mvnet_dev class\n");
+ ret = PTR_ERR(mvnet_dev.vd_class);
+ goto failed1;
+ }
+
+ mvnet_dev.dev.class = mvnet_dev.vd_class;
+ mvnet_dev.dev.release = mvnet_device_release;
+ dev_se...
2019 Nov 07
0
[PATCH V11 6/6] docs: sample driver to demonstrate how to implement virtio-mdev framework
...se(struct device *dev)
+{
+ dev_dbg(dev, "mvnet: released\n");
+}
+
+static int __init mvnet_dev_init(void)
+{
+ int ret = 0;
+
+ pr_info("mvnet_dev: %s\n", __func__);
+
+ memset(&mvnet_dev, 0, sizeof(mvnet_dev));
+
+ idr_init(&mvnet_dev.vd_idr);
+
+ mvnet_dev.vd_class = class_create(THIS_MODULE, MVNET_CLASS_NAME);
+
+ if (IS_ERR(mvnet_dev.vd_class)) {
+ pr_err("Error: failed to register mvnet_dev class\n");
+ ret = PTR_ERR(mvnet_dev.vd_class);
+ goto failed1;
+ }
+
+ mvnet_dev.dev.class = mvnet_dev.vd_class;
+ mvnet_dev.dev.release = mvnet_device_release;
+ dev_se...
2019 Nov 06
0
[PATCH V9 6/6] docs: sample driver to demonstrate how to implement virtio-mdev framework
...se(struct device *dev)
+{
+ dev_dbg(dev, "mvnet: released\n");
+}
+
+static int __init mvnet_dev_init(void)
+{
+ int ret = 0;
+
+ pr_info("mvnet_dev: %s\n", __func__);
+
+ memset(&mvnet_dev, 0, sizeof(mvnet_dev));
+
+ idr_init(&mvnet_dev.vd_idr);
+
+ mvnet_dev.vd_class = class_create(THIS_MODULE, MVNET_CLASS_NAME);
+
+ if (IS_ERR(mvnet_dev.vd_class)) {
+ pr_err("Error: failed to register mvnet_dev class\n");
+ ret = PTR_ERR(mvnet_dev.vd_class);
+ goto failed1;
+ }
+
+ mvnet_dev.dev.class = mvnet_dev.vd_class;
+ mvnet_dev.dev.release = mvnet_device_release;
+ dev_se...
2019 Nov 06
0
[PATCH V10 6/6] docs: sample driver to demonstrate how to implement virtio-mdev framework
...se(struct device *dev)
+{
+ dev_dbg(dev, "mvnet: released\n");
+}
+
+static int __init mvnet_dev_init(void)
+{
+ int ret = 0;
+
+ pr_info("mvnet_dev: %s\n", __func__);
+
+ memset(&mvnet_dev, 0, sizeof(mvnet_dev));
+
+ idr_init(&mvnet_dev.vd_idr);
+
+ mvnet_dev.vd_class = class_create(THIS_MODULE, MVNET_CLASS_NAME);
+
+ if (IS_ERR(mvnet_dev.vd_class)) {
+ pr_err("Error: failed to register mvnet_dev class\n");
+ ret = PTR_ERR(mvnet_dev.vd_class);
+ goto failed1;
+ }
+
+ mvnet_dev.dev.class = mvnet_dev.vd_class;
+ mvnet_dev.dev.release = mvnet_device_release;
+ dev_se...
2009 Aug 05
0
[PATCH] virtio_serial: A char device for simple guest <-> host communication
...table_size = ARRAY_SIZE(virtserial_features),
+ .driver.name = KBUILD_MODNAME,
+ .driver.owner = THIS_MODULE,
+ .id_table = id_table,
+ .probe = virtserial_probe,
+ .remove = virtserial_remove,
+ .config_changed = config_intr,
+};
+
+static int __init init(void)
+{
+ int ret;
+
+ virtserial.class = class_create(THIS_MODULE, "virtio-serial");
+ if (IS_ERR(virtserial.class)) {
+ pr_err("Error creating virtio-serial class\n");
+ ret = PTR_ERR(virtserial.class);
+ return ret;
+ }
+ ret = register_virtio_driver(&virtio_serial);
+ if (ret) {
+ class_destroy(virtserial.class);
+ retu...
2009 Aug 05
0
[PATCH] virtio_serial: A char device for simple guest <-> host communication
...table_size = ARRAY_SIZE(virtserial_features),
+ .driver.name = KBUILD_MODNAME,
+ .driver.owner = THIS_MODULE,
+ .id_table = id_table,
+ .probe = virtserial_probe,
+ .remove = virtserial_remove,
+ .config_changed = config_intr,
+};
+
+static int __init init(void)
+{
+ int ret;
+
+ virtserial.class = class_create(THIS_MODULE, "virtio-serial");
+ if (IS_ERR(virtserial.class)) {
+ pr_err("Error creating virtio-serial class\n");
+ ret = PTR_ERR(virtserial.class);
+ return ret;
+ }
+ ret = register_virtio_driver(&virtio_serial);
+ if (ret) {
+ class_destroy(virtserial.class);
+ retu...