File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -517,12 +517,15 @@ static int nct3018y_probe(struct i2c_client *client)
517
517
if (nct3018y -> part_num < 0 ) {
518
518
dev_dbg (& client -> dev , "Failed to read NCT3018Y_REG_PART.\n" );
519
519
return nct3018y -> part_num ;
520
- } else if (nct3018y -> part_num == NCT3018Y_REG_PART_NCT3018Y ) {
521
- flags = NCT3018Y_BIT_HF ;
522
- err = i2c_smbus_write_byte_data (client , NCT3018Y_REG_CTRL , flags );
523
- if (err < 0 ) {
524
- dev_dbg (& client -> dev , "Unable to write NCT3018Y_REG_CTRL.\n" );
525
- return err ;
520
+ } else {
521
+ nct3018y -> part_num &= 0x03 ; /* Part number is corresponding to bit 0 and 1 */
522
+ if (nct3018y -> part_num == NCT3018Y_REG_PART_NCT3018Y ) {
523
+ flags = NCT3018Y_BIT_HF ;
524
+ err = i2c_smbus_write_byte_data (client , NCT3018Y_REG_CTRL , flags );
525
+ if (err < 0 ) {
526
+ dev_dbg (& client -> dev , "Unable to write NCT3018Y_REG_CTRL.\n" );
527
+ return err ;
528
+ }
526
529
}
527
530
}
528
531
You can’t perform that action at this time.
0 commit comments