Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 14821
b: refs/heads/master
c: 9632051
h: refs/heads/master
i:
  14819: cead1fa
v: v3
  • Loading branch information
Jean Delvare authored and Greg Kroah-Hartman committed Nov 30, 2005
1 parent 83af628 commit e212ca4
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c801147c5a103eec864afee348c4ee3fdb0f380c
refs/heads/master: 9632051963cb6e6f7412990f8b962209b9334e13
5 changes: 1 addition & 4 deletions trunk/drivers/char/drm/drm_context.c
Original file line number Diff line number Diff line change
Expand Up @@ -432,10 +432,7 @@ int drm_addctx(struct inode *inode, struct file *filp,

if (ctx.handle != DRM_KERNEL_CONTEXT) {
if (dev->driver->context_ctor)
if (!dev->driver->context_ctor(dev, ctx.handle)) {
DRM_DEBUG( "Running out of ctxs or memory.\n");
return -ENOMEM;
}
dev->driver->context_ctor(dev, ctx.handle);
}

ctx_entry = drm_alloc(sizeof(*ctx_entry), DRM_MEM_CTXLIST);
Expand Down
25 changes: 18 additions & 7 deletions trunk/drivers/hwmon/w83792d.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ static const u8 W83792D_REG_LEVELS[3][4] = {
0xE2 } /* (bit3-0) SmartFanII: Fan3 Level 3 */
};

#define W83792D_REG_GPIO_EN 0x1A
#define W83792D_REG_CONFIG 0x40
#define W83792D_REG_VID_FANDIV 0x47
#define W83792D_REG_CHIPID 0x49
Expand Down Expand Up @@ -257,7 +258,7 @@ DIV_TO_REG(long val)
{
int i;
val = SENSORS_LIMIT(val, 1, 128) >> 1;
for (i = 0; i < 6; i++) {
for (i = 0; i < 7; i++) {
if (val == 0)
break;
val >>= 1;
Expand Down Expand Up @@ -1282,8 +1283,8 @@ w83792d_detect(struct i2c_adapter *adapter, int address, int kind)
w83792d_init_client(new_client);

/* A few vars need to be filled upon startup */
for (i = 1; i <= 7; i++) {
data->fan_min[i - 1] = w83792d_read_value(new_client,
for (i = 0; i < 7; i++) {
data->fan_min[i] = w83792d_read_value(new_client,
W83792D_REG_FAN_MIN[i]);
}

Expand All @@ -1306,10 +1307,20 @@ w83792d_detect(struct i2c_adapter *adapter, int address, int kind)
device_create_file_fan(new_client, 1);
device_create_file_fan(new_client, 2);
device_create_file_fan(new_client, 3);
device_create_file_fan(new_client, 4);
device_create_file_fan(new_client, 5);
device_create_file_fan(new_client, 6);
device_create_file_fan(new_client, 7);

/* Read GPIO enable register to check if pins for fan 4,5 are used as
GPIO */
val1 = w83792d_read_value(new_client, W83792D_REG_GPIO_EN);
if (!(val1 & 0x40))
device_create_file_fan(new_client, 4);
if (!(val1 & 0x20))
device_create_file_fan(new_client, 5);

val1 = w83792d_read_value(new_client, W83792D_REG_PIN);
if (val1 & 0x40)
device_create_file_fan(new_client, 6);
if (val1 & 0x04)
device_create_file_fan(new_client, 7);

device_create_file_temp1(new_client); /* Temp1 */
device_create_file_temp_add(new_client, 2); /* Temp2 */
Expand Down

0 comments on commit e212ca4

Please sign in to comment.