Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions driver/smi_stream_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -1050,7 +1050,12 @@ static int smi_stream_dev_probe(struct platform_device *pdev)
}

// Create sysfs entries with "smi-stream-dev"
#if defined(HAVE_CLASS_WITHOUT_OWNER) && HAVE_CLASS_WITHOUT_OWNER
smi_stream_class = class_create(DEVICE_NAME);
#else
smi_stream_class = class_create(THIS_MODULE, DEVICE_NAME);
#endif

ptr_err = smi_stream_class;
if (IS_ERR(ptr_err))
{
Expand Down
7 changes: 7 additions & 0 deletions driver/smi_stream_dev.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
#define _SMI_STREAM_DEV_H_

#include <linux/ioctl.h>
#include <linux/version.h>

#ifndef __KERNEL__
#include <stdint.h>
Expand All @@ -51,6 +52,12 @@
#define DRIVER_NAME "smi-stream-dev"
#define DEVICE_MINOR 0

#if ( LINUX_VERSION_CODE >= KERNEL_VERSION( 6, 4, 0) )
#define HAVE_CLASS_WITHOUT_OWNER 1
#else
#define HAVE_CLASS_WITHOUT_OWNER 0
#endif

typedef enum
{
smi_stream_dir_smi_to_device = 0, // device data-bus is highZ (TX)
Expand Down