sht15.c (864bfb25b57a6766ea689befa5cf09a4353281ce) | sht15.c (a8b3a3a53f9a814e9938ea9cc179086ff5c0a387) |
---|---|
1/* 2 * sht15.c - support for the SHT15 Temperature and Humidity Sensor 3 * 4 * Portions Copyright (c) 2010-2012 Savoir-faire Linux Inc. 5 * Jerome Oufella <jerome.oufella@savoirfairelinux.com> 6 * Vivien Didelot <vivien.didelot@savoirfairelinux.com> 7 * 8 * Copyright (c) 2009 Jonathan Cameron --- 926 unchanged lines hidden (view full) --- 935 936 INIT_WORK(&data->read_work, sht15_bh_read_data); 937 INIT_WORK(&data->update_supply_work, sht15_update_voltage); 938 platform_set_drvdata(pdev, data); 939 mutex_init(&data->read_lock); 940 data->dev = &pdev->dev; 941 init_waitqueue_head(&data->wait_queue); 942 | 1/* 2 * sht15.c - support for the SHT15 Temperature and Humidity Sensor 3 * 4 * Portions Copyright (c) 2010-2012 Savoir-faire Linux Inc. 5 * Jerome Oufella <jerome.oufella@savoirfairelinux.com> 6 * Vivien Didelot <vivien.didelot@savoirfairelinux.com> 7 * 8 * Copyright (c) 2009 Jonathan Cameron --- 926 unchanged lines hidden (view full) --- 935 936 INIT_WORK(&data->read_work, sht15_bh_read_data); 937 INIT_WORK(&data->update_supply_work, sht15_update_voltage); 938 platform_set_drvdata(pdev, data); 939 mutex_init(&data->read_lock); 940 data->dev = &pdev->dev; 941 init_waitqueue_head(&data->wait_queue); 942 |
943 if (pdev->dev.platform_data == NULL) { | 943 if (dev_get_platdata(&pdev->dev) == NULL) { |
944 dev_err(&pdev->dev, "no platform data supplied\n"); 945 return -EINVAL; 946 } | 944 dev_err(&pdev->dev, "no platform data supplied\n"); 945 return -EINVAL; 946 } |
947 data->pdata = pdev->dev.platform_data; | 947 data->pdata = dev_get_platdata(&pdev->dev); |
948 data->supply_uv = data->pdata->supply_mv * 1000; 949 if (data->pdata->checksum) 950 data->checksumming = true; 951 if (data->pdata->no_otp_reload) 952 status |= SHT15_STATUS_NO_OTP_RELOAD; 953 if (data->pdata->low_resolution) 954 status |= SHT15_STATUS_LOW_RESOLUTION; 955 --- 144 unchanged lines hidden --- | 948 data->supply_uv = data->pdata->supply_mv * 1000; 949 if (data->pdata->checksum) 950 data->checksumming = true; 951 if (data->pdata->no_otp_reload) 952 status |= SHT15_STATUS_NO_OTP_RELOAD; 953 if (data->pdata->low_resolution) 954 status |= SHT15_STATUS_LOW_RESOLUTION; 955 --- 144 unchanged lines hidden --- |