Lines Matching refs:unitp

148 	struct ltc1427_unit *unitp;
158 unitp = (struct ltc1427_unit *)
161 if (unitp == NULL) {
169 mutex_enter(&unitp->ltc1427_mutex);
172 if (unitp->ltc1427_oflag != 0) {
175 unitp->ltc1427_oflag = FEXCL;
178 if (unitp->ltc1427_oflag == FEXCL) {
181 unitp->ltc1427_oflag = FOPEN;
185 mutex_exit(&unitp->ltc1427_mutex);
195 struct ltc1427_unit *unitp;
204 unitp = (struct ltc1427_unit *)
207 if (unitp == NULL) {
211 mutex_enter(&unitp->ltc1427_mutex);
213 unitp->ltc1427_oflag = 0;
215 mutex_exit(&unitp->ltc1427_mutex);
225 struct ltc1427_unit *unitp;
238 unitp = (struct ltc1427_unit *)
241 mutex_enter(&unitp->ltc1427_mutex);
246 unitp->current_set_flag));
247 if (unitp->current_set_flag == 0) {
251 if (ddi_copyout((caddr_t)&unitp->current_value,
257 unitp->ltc1427_name));
270 unitp->ltc1427_name));
275 (void) i2c_transfer_alloc(unitp->ltc1427_hdl,
281 unitp->ltc1427_name));
291 err = i2c_transfer(unitp->ltc1427_hdl, i2c_tran_pointer);
293 unitp->current_value = fan_speed;
294 unitp->current_set_flag = 1;
296 i2c_transfer_free(unitp->ltc1427_hdl, i2c_tran_pointer);
301 unitp->ltc1427_name, cmd));
305 mutex_exit(&unitp->ltc1427_mutex);
338 struct ltc1427_unit *unitp;
349 unitp = ddi_get_soft_state(ltc1427soft_statep, instance);
351 if (unitp == NULL) {
352 cmn_err(CE_WARN, "%s%d: unitp not filled\n",
357 (void) snprintf(unitp->ltc1427_name, sizeof (unitp->ltc1427_name),
363 "%s\n", unitp->ltc1427_name, "ltc1427");
369 if (i2c_client_register(dip, &unitp->ltc1427_hdl) != I2C_SUCCESS) {
376 mutex_init(&unitp->ltc1427_mutex, NULL, MUTEX_DRIVER, NULL);
400 struct ltc1427_unit *unitp;
405 unitp = ddi_get_soft_state(ltc1427soft_statep, instance);
407 if (unitp == NULL) {
408 cmn_err(CE_WARN, "%s%d: unitp not filled\n",
413 i2c_client_unregister(unitp->ltc1427_hdl);
417 mutex_destroy(&unitp->ltc1427_mutex);