hwmon.c (1d33369db25eb7f37b7a8bd22d736888b4501a9c) | hwmon.c (38d8ed65092ed22f52a95f397855cace0260e110) |
---|---|
1/* 2 * hwmon.c - part of lm_sensors, Linux kernel modules for hardware monitoring 3 * 4 * This file defines the sysfs class "hwmon", for use by sensors drivers. 5 * 6 * Copyright (C) 2005 Mark M. Hoffman <mhoffman@lightlink.com> 7 * 8 * This program is free software; you can redistribute it and/or modify --- 522 unchanged lines hidden (view full) --- 531 int ngroups = 2; 532 533 if (groups) 534 for (i = 0; groups[i]; i++) 535 ngroups++; 536 537 hwdev->groups = devm_kcalloc(dev, ngroups, sizeof(*groups), 538 GFP_KERNEL); | 1/* 2 * hwmon.c - part of lm_sensors, Linux kernel modules for hardware monitoring 3 * 4 * This file defines the sysfs class "hwmon", for use by sensors drivers. 5 * 6 * Copyright (C) 2005 Mark M. Hoffman <mhoffman@lightlink.com> 7 * 8 * This program is free software; you can redistribute it and/or modify --- 522 unchanged lines hidden (view full) --- 531 int ngroups = 2; 532 533 if (groups) 534 for (i = 0; groups[i]; i++) 535 ngroups++; 536 537 hwdev->groups = devm_kcalloc(dev, ngroups, sizeof(*groups), 538 GFP_KERNEL); |
539 if (!hwdev->groups) 540 return ERR_PTR(-ENOMEM); | 539 if (!hwdev->groups) { 540 err = -ENOMEM; 541 goto free_hwmon; 542 } |
541 542 attrs = __hwmon_create_attrs(dev, drvdata, chip); 543 if (IS_ERR(attrs)) { 544 err = PTR_ERR(attrs); 545 goto free_hwmon; 546 } 547 548 hwdev->group.attrs = attrs; --- 291 unchanged lines hidden --- | 543 544 attrs = __hwmon_create_attrs(dev, drvdata, chip); 545 if (IS_ERR(attrs)) { 546 err = PTR_ERR(attrs); 547 goto free_hwmon; 548 } 549 550 hwdev->group.attrs = attrs; --- 291 unchanged lines hidden --- |