~ubuntu-branches/ubuntu/lucid/skyeye/lucid-proposed

« back to all changes in this revision

Viewing changes to device/skyeye_device.c

  • Committer: Bazaar Package Importer
  • Author(s): Yu Guanghui
  • Date: 2007-08-07 13:25:49 UTC
  • mfrom: (1.1.2 upstream) (2.1.1 lenny)
  • Revision ID: james.westby@ubuntu.com-20070807132549-96159k1obat1fxr0
Tags: 1.2.3-1
* New upstream release
* Added NO_BFD=1, don't require libbfd now. (Closes:Bug#423933) 

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
        lcd_register ();
43
43
#endif
44
44
        flash_register ();
 
45
        touchscreen_register ();
 
46
        sound_register ();
45
47
}
46
48
 
47
49
void
113
115
                mod_set->initialized = 1;
114
116
        }
115
117
        if ((dev_mod = find_module (conf->type, mod_set)) == NULL) {
116
 
                SKYEYE_ERR ("can't find device module: %s\n", conf->type);
 
118
                SKYEYE_ERR ("can't find device module: (name:%s, type:%s)\n",
 
119
                            mod_set->name, conf->type);
117
120
                return 1;
118
121
        }
119
122
        mc->devices = realloc (mc->devices,
120
123
                               sizeof (struct device_desc *) *
121
124
                               (mc->dev_count + 1));
122
125
        if (mc->devices == NULL) {
123
 
                SKYEYE_ERR ("can't alloc memory for devices pionter: %s\n",
124
 
                            conf->type);
 
126
                SKYEYE_ERR ("can't alloc memory for devices pionter: (name:%s, type:%s)\n",
 
127
                            mod_set->name, conf->type);
125
128
                return 1;
126
129
        }
127
130
        dev = malloc (sizeof (struct device_desc));
128
131
        if (dev == NULL) {
129
 
                SKYEYE_ERR ("can't alloc memory for new device: %s\n",
130
 
                            conf->type);
 
132
                SKYEYE_ERR ("can't alloc memory for new device: (name:%s, type:%s)\n",
 
133
                            mod_set->name, conf->type);
131
134
                return 1;
132
135
        }
133
136
        /* init device
156
159
 
157
160
        /* setup device module data
158
161
         * */
159
 
        if (mod_set->setup_module)
160
 
                mod_set->setup_module (dev, option);
 
162
        if (mod_set->setup_module) {
 
163
                if (mod_set->setup_module (dev, option) != 0) {
 
164
                        free(dev);
 
165
                        SKYEYE_ERR ("failed to setup_module (name:%s, type:%s)\n",
 
166
                                    mod_set->name, conf->type);
 
167
                        return 1;
 
168
                }
 
169
        }
 
170
 
161
171
        mc->devices[mc->dev_count] = dev;
162
172
        mc->dev_count++;
163
173