@@ -509,6 +509,8 @@ static struct pdcspath_entry *pdcspath_entries[] = {
509509
510510/**
511511 * pdcs_size_read - Stable Storage size output.
512+ * @kobj: The kobject used to share data with userspace.
513+ * @attr: The kobject attributes.
512514 * @buf: The output buffer to write to.
513515 */
514516static ssize_t pdcs_size_read (struct kobject * kobj ,
@@ -528,6 +530,8 @@ static ssize_t pdcs_size_read(struct kobject *kobj,
528530
529531/**
530532 * pdcs_auto_read - Stable Storage autoboot/search flag output.
533+ * @kobj: The kobject used to share data with userspace.
534+ * @attr: The kobject attributes.
531535 * @buf: The output buffer to write to.
532536 * @knob: The PF_AUTOBOOT or PF_AUTOSEARCH flag
533537 */
@@ -554,6 +558,8 @@ static ssize_t pdcs_auto_read(struct kobject *kobj,
554558
555559/**
556560 * pdcs_autoboot_read - Stable Storage autoboot flag output.
561+ * @kobj: The kobject used to share data with userspace.
562+ * @attr: The kobject attributes.
557563 * @buf: The output buffer to write to.
558564 */
559565static ssize_t pdcs_autoboot_read (struct kobject * kobj ,
@@ -564,6 +570,8 @@ static ssize_t pdcs_autoboot_read(struct kobject *kobj,
564570
565571/**
566572 * pdcs_autosearch_read - Stable Storage autoboot flag output.
573+ * @kobj: The kobject used to share data with userspace.
574+ * @attr: The kobject attributes.
567575 * @buf: The output buffer to write to.
568576 */
569577static ssize_t pdcs_autosearch_read (struct kobject * kobj ,
@@ -574,6 +582,8 @@ static ssize_t pdcs_autosearch_read(struct kobject *kobj,
574582
575583/**
576584 * pdcs_timer_read - Stable Storage timer count output (in seconds).
585+ * @kobj: The kobject used to share data with userspace.
586+ * @attr: The kobject attributes.
577587 * @buf: The output buffer to write to.
578588 *
579589 * The value of the timer field correponds to a number of seconds in powers of 2.
@@ -601,6 +611,8 @@ static ssize_t pdcs_timer_read(struct kobject *kobj,
601611
602612/**
603613 * pdcs_osid_read - Stable Storage OS ID register output.
614+ * @kobj: The kobject used to share data with userspace.
615+ * @attr: The kobject attributes.
604616 * @buf: The output buffer to write to.
605617 */
606618static ssize_t pdcs_osid_read (struct kobject * kobj ,
@@ -619,6 +631,8 @@ static ssize_t pdcs_osid_read(struct kobject *kobj,
619631
620632/**
621633 * pdcs_osdep1_read - Stable Storage OS-Dependent data area 1 output.
634+ * @kobj: The kobject used to share data with userspace.
635+ * @attr: The kobject attributes.
622636 * @buf: The output buffer to write to.
623637 *
624638 * This can hold 16 bytes of OS-Dependent data.
@@ -645,6 +659,8 @@ static ssize_t pdcs_osdep1_read(struct kobject *kobj,
645659
646660/**
647661 * pdcs_diagnostic_read - Stable Storage Diagnostic register output.
662+ * @kobj: The kobject used to share data with userspace.
663+ * @attr: The kobject attributes.
648664 * @buf: The output buffer to write to.
649665 *
650666 * I have NFC how to interpret the content of that register ;-).
@@ -669,6 +685,8 @@ static ssize_t pdcs_diagnostic_read(struct kobject *kobj,
669685
670686/**
671687 * pdcs_fastsize_read - Stable Storage FastSize register output.
688+ * @kobj: The kobject used to share data with userspace.
689+ * @attr: The kobject attributes.
672690 * @buf: The output buffer to write to.
673691 *
674692 * This register holds the amount of system RAM to be tested during boot sequence.
@@ -697,6 +715,8 @@ static ssize_t pdcs_fastsize_read(struct kobject *kobj,
697715
698716/**
699717 * pdcs_osdep2_read - Stable Storage OS-Dependent data area 2 output.
718+ * @kobj: The kobject used to share data with userspace.
719+ * @attr: The kobject attributes.
700720 * @buf: The output buffer to write to.
701721 *
702722 * This can hold pdcs_size - 224 bytes of OS-Dependent data, when available.
@@ -729,6 +749,8 @@ static ssize_t pdcs_osdep2_read(struct kobject *kobj,
729749
730750/**
731751 * pdcs_auto_write - This function handles autoboot/search flag modifying.
752+ * @kobj: The kobject used to share data with userspace.
753+ * @attr: The kobject attributes.
732754 * @buf: The input buffer to read from.
733755 * @count: The number of bytes to be read.
734756 * @knob: The PF_AUTOBOOT or PF_AUTOSEARCH flag
@@ -801,6 +823,8 @@ static ssize_t pdcs_auto_write(struct kobject *kobj,
801823
802824/**
803825 * pdcs_autoboot_write - This function handles autoboot flag modifying.
826+ * @kobj: The kobject used to share data with userspace.
827+ * @attr: The kobject attributes.
804828 * @buf: The input buffer to read from.
805829 * @count: The number of bytes to be read.
806830 *
@@ -817,6 +841,8 @@ static ssize_t pdcs_autoboot_write(struct kobject *kobj,
817841
818842/**
819843 * pdcs_autosearch_write - This function handles autosearch flag modifying.
844+ * @kobj: The kobject used to share data with userspace.
845+ * @attr: The kobject attributes.
820846 * @buf: The input buffer to read from.
821847 * @count: The number of bytes to be read.
822848 *
@@ -833,6 +859,8 @@ static ssize_t pdcs_autosearch_write(struct kobject *kobj,
833859
834860/**
835861 * pdcs_osdep1_write - Stable Storage OS-Dependent data area 1 input.
862+ * @kobj: The kobject used to share data with userspace.
863+ * @attr: The kobject attributes.
836864 * @buf: The input buffer to read from.
837865 * @count: The number of bytes to be read.
838866 *
@@ -870,6 +898,8 @@ static ssize_t pdcs_osdep1_write(struct kobject *kobj,
870898
871899/**
872900 * pdcs_osdep2_write - Stable Storage OS-Dependent data area 2 input.
901+ * @kobj: The kobject used to share data with userspace.
902+ * @attr: The kobject attributes.
873903 * @buf: The input buffer to read from.
874904 * @count: The number of bytes to be read.
875905 *
@@ -1023,7 +1053,7 @@ pdcs_unregister_pathentries(void)
10231053static int __init
10241054pdc_stable_init (void )
10251055{
1026- int rc = 0 , error = 0 ;
1056+ int rc = 0 , error ;
10271057 u32 result ;
10281058
10291059 /* find the size of the stable storage */
@@ -1052,6 +1082,10 @@ pdc_stable_init(void)
10521082
10531083 /* Don't forget the root entries */
10541084 error = sysfs_create_group (stable_kobj , & pdcs_attr_group );
1085+ if (error ) {
1086+ rc = - ENOMEM ;
1087+ goto fail_ksetreg ;
1088+ }
10551089
10561090 /* register the paths kset as a child of the stable kset */
10571091 paths_kset = kset_create_and_add ("paths" , NULL , stable_kobj );
0 commit comments