소스 검색

rtc6226: Make remove callback return void

The value returned by an i2c driver's remove function is mostly
ignored, so the prototype of the remove function was changed to
return no value.

So change the related remove callback return void.

Change-Id: Iba2d83fe7f11ddfaabc67171b3ed7ee6955680be
jianzhou 2 년 전
부모
커밋
a4d571f1da
1개의 변경된 파일7개의 추가작업 그리고 1개의 파일을 삭제
  1. 7 1
      rtc6226/radio-rtc6226-i2c.c

+ 7 - 1
rtc6226/radio-rtc6226-i2c.c

@@ -36,6 +36,7 @@
 #include <linux/regulator/consumer.h>
 #include "radio-rtc6226.h"
 #include <linux/workqueue.h>
+#include <linux/version.h>
 
 static const struct of_device_id rtc6226_i2c_dt_ids[] = {
 	{.compatible = "rtc6226"},
@@ -929,7 +930,11 @@ err_vreg:
 /*
  * rtc6226_i2c_remove - remove the device
  */
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0))
+static void rtc6226_i2c_remove(struct i2c_client *client)
+#else
 static int rtc6226_i2c_remove(struct i2c_client *client)
+#endif
 {
 	struct rtc6226_device *radio = i2c_get_clientdata(client);
 
@@ -942,8 +947,9 @@ static int rtc6226_i2c_remove(struct i2c_client *client)
 	v4l2_device_unregister(&radio->v4l2_dev);
 	kfree(radio);
 	FMDBG("%s exit\n", __func__);
-
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0))
 	return 0;
+#endif
 }
 
 #ifdef CONFIG_PM