forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-11 297b60346df8beafee954a0fd7c2d64f33f3b9bc
kernel/arch/arm/mach-omap2/id.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * linux/arch/arm/mach-omap2/id.c
34 *
....@@ -8,10 +9,6 @@
89 *
910 * Copyright (C) 2009-11 Texas Instruments
1011 * Added OMAP4 support - Santosh Shilimkar <santosh.shilimkar@ti.com>
11
- *
12
- * This program is free software; you can redistribute it and/or modify
13
- * it under the terms of the GNU General Public License version 2 as
14
- * published by the Free Software Foundation.
1512 */
1613
1714 #include <linux/module.h>
....@@ -399,7 +396,6 @@
399396 cpu_rev = "3.1";
400397 break;
401398 case 7:
402
- /* FALLTHROUGH */
403399 default:
404400 /* Use the latest known revision as default */
405401 omap_revision = OMAP3430_REV_ES3_1_2;
....@@ -419,7 +415,6 @@
419415 cpu_rev = "1.0";
420416 break;
421417 case 1:
422
- /* FALLTHROUGH */
423418 default:
424419 omap_revision = AM35XX_REV_ES1_1;
425420 cpu_rev = "1.1";
....@@ -438,7 +433,6 @@
438433 cpu_rev = "1.1";
439434 break;
440435 case 2:
441
- /* FALLTHROUGH */
442436 default:
443437 omap_revision = OMAP3630_REV_ES1_2;
444438 cpu_rev = "1.2";
....@@ -459,7 +453,6 @@
459453 cpu_rev = "2.0";
460454 break;
461455 case 3:
462
- /* FALLTHROUGH */
463456 default:
464457 omap_revision = TI8168_REV_ES2_1;
465458 cpu_rev = "2.1";
....@@ -476,7 +469,6 @@
476469 cpu_rev = "2.0";
477470 break;
478471 case 2:
479
- /* FALLTHROUGH */
480472 default:
481473 omap_revision = AM335X_REV_ES2_1;
482474 cpu_rev = "2.1";
....@@ -494,7 +486,6 @@
494486 cpu_rev = "1.1";
495487 break;
496488 case 2:
497
- /* FALLTHROUGH */
498489 default:
499490 omap_revision = AM437X_REV_ES1_2;
500491 cpu_rev = "1.2";
....@@ -505,7 +496,6 @@
505496 case 0xb968:
506497 switch (rev) {
507498 case 0:
508
- /* FALLTHROUGH */
509499 case 1:
510500 omap_revision = TI8148_REV_ES1_0;
511501 cpu_rev = "1.0";
....@@ -515,7 +505,6 @@
515505 cpu_rev = "2.0";
516506 break;
517507 case 3:
518
- /* FALLTHROUGH */
519508 default:
520509 omap_revision = TI8148_REV_ES2_1;
521510 cpu_rev = "2.1";
....@@ -778,19 +767,23 @@
778767 return kasprintf(GFP_KERNEL, "Unknown");
779768 }
780769
781
-static ssize_t omap_get_type(struct device *dev,
782
- struct device_attribute *attr,
783
- char *buf)
770
+static ssize_t
771
+type_show(struct device *dev, struct device_attribute *attr, char *buf)
784772 {
785773 return sprintf(buf, "%s\n", omap_types[omap_type()]);
786774 }
787775
788
-static struct device_attribute omap_soc_attr =
789
- __ATTR(type, S_IRUGO, omap_get_type, NULL);
776
+static DEVICE_ATTR_RO(type);
777
+
778
+static struct attribute *omap_soc_attrs[] = {
779
+ &dev_attr_type.attr,
780
+ NULL
781
+};
782
+
783
+ATTRIBUTE_GROUPS(omap_soc);
790784
791785 void __init omap_soc_device_init(void)
792786 {
793
- struct device *parent;
794787 struct soc_device *soc_dev;
795788 struct soc_device_attribute *soc_dev_attr;
796789
....@@ -801,14 +794,12 @@
801794 soc_dev_attr->machine = soc_name;
802795 soc_dev_attr->family = omap_get_family();
803796 soc_dev_attr->revision = soc_rev;
797
+ soc_dev_attr->custom_attr_group = omap_soc_groups[0];
804798
805799 soc_dev = soc_device_register(soc_dev_attr);
806800 if (IS_ERR(soc_dev)) {
807801 kfree(soc_dev_attr);
808802 return;
809803 }
810
-
811
- parent = soc_device_to_device(soc_dev);
812
- device_create_file(parent, &omap_soc_attr);
813804 }
814805 #endif /* CONFIG_SOC_BUS */