+
+/**
+ * register_obj_struct - registers message object into global array
+ * @obj: the initialized message object being registered
+ * @minorbase: wanted minor number, if (-1) automatically selected
+ *
+ * Return Value: returns negative number in the case of fail
+ */
+int register_obj_struct(struct msgobj_t *obj, int minorbase)
+{
+ static int next_minor=0;
+ int i;
+
+ if(minorbase>=0)
+ next_minor=minorbase;
+ if(next_minor>=MAX_TOT_MSGOBJS)
+ next_minor=0;
+ i=next_minor;
+ do{
+ if(objects_p[i]==NULL){
+ objects_p[i]=obj;
+ obj->minor=i;
+ next_minor=i+1;
+ return 0;
+ }
+ if(++i >= MAX_TOT_MSGOBJS) i=0;
+ }while(i!=next_minor);
+ obj->minor=-1;
+ return -1;
+}
+
+
+/**
+ * register_chip_struct - registers chip into global array
+ * @chip: the initialized chip structure being registered
+ * @minorbase: wanted minor number base, if (-1) automatically selected
+ *
+ * Return Value: returns negative number in the case of fail
+ */
+int register_chip_struct(struct chip_t *chip, int minorbase)
+{
+ static int next_chip_slot=0;
+ int i;
+
+ if(next_chip_slot>=MAX_TOT_CHIPS)
+ next_chip_slot=0;
+ i=next_chip_slot;
+ do{
+ if(chips_p[i]==NULL){
+ chips_p[i]=chip;
+
+ next_chip_slot=i+1;
+ return 0;
+ }
+ if(++i >= MAX_TOT_CHIPS) i=0;
+ }while(i!=next_chip_slot);
+ return -1;
+}
+
+
+
+/**
+ * init_hw_struct - initializes driver hardware description structures
+ *
+ * The function init_hw_struct() is used to initialize the hardware structure.
+ *
+ * Return Value: returns negative number in the case of fail
+ */