aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2013-08-14 04:07:09 -0400
committerJiri Kosina <jkosina@suse.cz>2013-09-04 06:19:12 -0400
commit5902fde19a3b3e51a0a246e98d337f291bbc07b0 (patch)
tree4eb8712eb94434c3fedf4548d155e78651eab7d4 /drivers/hid
parent58c59bc997d86593f0bea41845885917cf304d22 (diff)
HID: hid-sensor-hub: fix indentation accross the code
Patch just rearranges lines to be more compact and/or readable. Additionally it converts double space to one in several places. There is no functional change. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid')
-rw-r--r--drivers/hid/hid-sensor-hub.c31
1 files changed, 15 insertions, 16 deletions
diff --git a/drivers/hid/hid-sensor-hub.c b/drivers/hid/hid-sensor-hub.c
index ca7498107327..7ebef9c7444a 100644
--- a/drivers/hid/hid-sensor-hub.c
+++ b/drivers/hid/hid-sensor-hub.c
@@ -103,8 +103,7 @@ static int sensor_hub_get_physical_device_count(
103 103
104 list_for_each_entry(report, &report_enum->report_list, list) { 104 list_for_each_entry(report, &report_enum->report_list, list) {
105 field = report->field[0]; 105 field = report->field[0];
106 if (report->maxfield && field && 106 if (report->maxfield && field && field->physical)
107 field->physical)
108 cnt++; 107 cnt++;
109 } 108 }
110 109
@@ -192,12 +191,12 @@ int sensor_hub_set_feature(struct hid_sensor_hub_device *hsdev, u32 report_id,
192 u32 field_index, s32 value) 191 u32 field_index, s32 value)
193{ 192{
194 struct hid_report *report; 193 struct hid_report *report;
195 struct sensor_hub_data *data = hid_get_drvdata(hsdev->hdev); 194 struct sensor_hub_data *data = hid_get_drvdata(hsdev->hdev);
196 int ret = 0; 195 int ret = 0;
197 196
198 mutex_lock(&data->mutex); 197 mutex_lock(&data->mutex);
199 report = sensor_hub_report(report_id, hsdev->hdev, HID_FEATURE_REPORT); 198 report = sensor_hub_report(report_id, hsdev->hdev, HID_FEATURE_REPORT);
200 if (!report || (field_index >= report->maxfield)) { 199 if (!report || (field_index >= report->maxfield)) {
201 ret = -EINVAL; 200 ret = -EINVAL;
202 goto done_proc; 201 goto done_proc;
203 } 202 }
@@ -216,12 +215,12 @@ int sensor_hub_get_feature(struct hid_sensor_hub_device *hsdev, u32 report_id,
216 u32 field_index, s32 *value) 215 u32 field_index, s32 *value)
217{ 216{
218 struct hid_report *report; 217 struct hid_report *report;
219 struct sensor_hub_data *data = hid_get_drvdata(hsdev->hdev); 218 struct sensor_hub_data *data = hid_get_drvdata(hsdev->hdev);
220 int ret = 0; 219 int ret = 0;
221 220
222 mutex_lock(&data->mutex); 221 mutex_lock(&data->mutex);
223 report = sensor_hub_report(report_id, hsdev->hdev, HID_FEATURE_REPORT); 222 report = sensor_hub_report(report_id, hsdev->hdev, HID_FEATURE_REPORT);
224 if (!report || (field_index >= report->maxfield)) { 223 if (!report || (field_index >= report->maxfield)) {
225 ret = -EINVAL; 224 ret = -EINVAL;
226 goto done_proc; 225 goto done_proc;
227 } 226 }
@@ -241,7 +240,7 @@ int sensor_hub_input_attr_get_raw_value(struct hid_sensor_hub_device *hsdev,
241 u32 usage_id, 240 u32 usage_id,
242 u32 attr_usage_id, u32 report_id) 241 u32 attr_usage_id, u32 report_id)
243{ 242{
244 struct sensor_hub_data *data = hid_get_drvdata(hsdev->hdev); 243 struct sensor_hub_data *data = hid_get_drvdata(hsdev->hdev);
245 unsigned long flags; 244 unsigned long flags;
246 struct hid_report *report; 245 struct hid_report *report;
247 int ret_val = 0; 246 int ret_val = 0;
@@ -302,7 +301,7 @@ int sensor_hub_input_get_attribute_info(struct hid_sensor_hub_device *hsdev,
302 301
303 /* Initialize with defaults */ 302 /* Initialize with defaults */
304 info->usage_id = usage_id; 303 info->usage_id = usage_id;
305 info->attrib_id = attr_usage_id; 304 info->attrib_id = attr_usage_id;
306 info->report_id = -1; 305 info->report_id = -1;
307 info->index = -1; 306 info->index = -1;
308 info->units = -1; 307 info->units = -1;
@@ -333,7 +332,7 @@ int sensor_hub_input_get_attribute_info(struct hid_sensor_hub_device *hsdev,
333 if (field->usage[j].hid == 332 if (field->usage[j].hid ==
334 attr_usage_id && 333 attr_usage_id &&
335 field->usage[j].collection_index == 334 field->usage[j].collection_index ==
336 collection_index) { 335 collection_index) {
337 sensor_hub_fill_attr_info(info, 336 sensor_hub_fill_attr_info(info,
338 i, report->id, 337 i, report->id,
339 field->unit, 338 field->unit,
@@ -357,7 +356,7 @@ EXPORT_SYMBOL_GPL(sensor_hub_input_get_attribute_info);
357#ifdef CONFIG_PM 356#ifdef CONFIG_PM
358static int sensor_hub_suspend(struct hid_device *hdev, pm_message_t message) 357static int sensor_hub_suspend(struct hid_device *hdev, pm_message_t message)
359{ 358{
360 struct sensor_hub_data *pdata = hid_get_drvdata(hdev); 359 struct sensor_hub_data *pdata = hid_get_drvdata(hdev);
361 struct hid_sensor_hub_callbacks_list *callback; 360 struct hid_sensor_hub_callbacks_list *callback;
362 361
363 hid_dbg(hdev, " sensor_hub_suspend\n"); 362 hid_dbg(hdev, " sensor_hub_suspend\n");
@@ -374,7 +373,7 @@ static int sensor_hub_suspend(struct hid_device *hdev, pm_message_t message)
374 373
375static int sensor_hub_resume(struct hid_device *hdev) 374static int sensor_hub_resume(struct hid_device *hdev)
376{ 375{
377 struct sensor_hub_data *pdata = hid_get_drvdata(hdev); 376 struct sensor_hub_data *pdata = hid_get_drvdata(hdev);
378 struct hid_sensor_hub_callbacks_list *callback; 377 struct hid_sensor_hub_callbacks_list *callback;
379 378
380 hid_dbg(hdev, " sensor_hub_resume\n"); 379 hid_dbg(hdev, " sensor_hub_resume\n");
@@ -394,6 +393,7 @@ static int sensor_hub_reset_resume(struct hid_device *hdev)
394 return 0; 393 return 0;
395} 394}
396#endif 395#endif
396
397/* 397/*
398 * Handle raw report as sent by device 398 * Handle raw report as sent by device
399 */ 399 */
@@ -421,7 +421,6 @@ static int sensor_hub_raw_event(struct hid_device *hdev,
421 spin_lock_irqsave(&pdata->lock, flags); 421 spin_lock_irqsave(&pdata->lock, flags);
422 422
423 for (i = 0; i < report->maxfield; ++i) { 423 for (i = 0; i < report->maxfield; ++i) {
424
425 hid_dbg(hdev, "%d collection_index:%x hid:%x sz:%x\n", 424 hid_dbg(hdev, "%d collection_index:%x hid:%x sz:%x\n",
426 i, report->field[i]->usage->collection_index, 425 i, report->field[i]->usage->collection_index,
427 report->field[i]->usage->hid, 426 report->field[i]->usage->hid,
@@ -434,7 +433,7 @@ static int sensor_hub_raw_event(struct hid_device *hdev,
434 pdata->pending.raw_data = kmalloc(sz, GFP_ATOMIC); 433 pdata->pending.raw_data = kmalloc(sz, GFP_ATOMIC);
435 if (pdata->pending.raw_data) { 434 if (pdata->pending.raw_data) {
436 memcpy(pdata->pending.raw_data, ptr, sz); 435 memcpy(pdata->pending.raw_data, ptr, sz);
437 pdata->pending.raw_size = sz; 436 pdata->pending.raw_size = sz;
438 } else 437 } else
439 pdata->pending.raw_size = 0; 438 pdata->pending.raw_size = 0;
440 complete(&pdata->pending.ready); 439 complete(&pdata->pending.ready);
@@ -539,7 +538,7 @@ static int sensor_hub_probe(struct hid_device *hdev,
539 field->physical) { 538 field->physical) {
540 name = kasprintf(GFP_KERNEL, "HID-SENSOR-%x", 539 name = kasprintf(GFP_KERNEL, "HID-SENSOR-%x",
541 field->physical); 540 field->physical);
542 if (name == NULL) { 541 if (name == NULL) {
543 hid_err(hdev, "Failed MFD device name\n"); 542 hid_err(hdev, "Failed MFD device name\n");
544 ret = -ENOMEM; 543 ret = -ENOMEM;
545 goto err_free_names; 544 goto err_free_names;
@@ -617,8 +616,8 @@ static struct hid_driver sensor_hub_driver = {
617 .raw_event = sensor_hub_raw_event, 616 .raw_event = sensor_hub_raw_event,
618#ifdef CONFIG_PM 617#ifdef CONFIG_PM
619 .suspend = sensor_hub_suspend, 618 .suspend = sensor_hub_suspend,
620 .resume = sensor_hub_resume, 619 .resume = sensor_hub_resume,
621 .reset_resume = sensor_hub_reset_resume, 620 .reset_resume = sensor_hub_reset_resume,
622#endif 621#endif
623}; 622};
624module_hid_driver(sensor_hub_driver); 623module_hid_driver(sensor_hub_driver);