Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
a150d95b
Commit
a150d95b
authored
Jul 11, 2013
by
Guenter Roeck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hwmon: (nct6775) Convert to use devm_hwmon_device_register_with_groups
Signed-off-by:
Guenter Roeck
<
linux@roeck-us.net
>
parent
74188cba
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
16 deletions
+5
-16
drivers/hwmon/nct6775.c
drivers/hwmon/nct6775.c
+5
-16
No files found.
drivers/hwmon/nct6775.c
View file @
a150d95b
...
...
@@ -724,8 +724,6 @@ struct nct6775_data {
enum
kinds
kind
;
const
char
*
name
;
struct
device
*
hwmon_dev
;
int
num_attr_groups
;
const
struct
attribute_group
*
groups
[
6
];
...
...
@@ -3260,6 +3258,7 @@ static int nct6775_probe(struct platform_device *pdev)
int
num_reg_temp
;
u8
cr2a
;
struct
attribute_group
*
group
;
struct
device
*
hwmon_dev
;
res
=
platform_get_resource
(
pdev
,
IORESOURCE_IO
,
0
);
if
(
!
devm_request_region
(
&
pdev
->
dev
,
res
->
start
,
IOREGION_LENGTH
,
...
...
@@ -3861,19 +3860,10 @@ static int nct6775_probe(struct platform_device *pdev)
data
->
groups
[
data
->
num_attr_groups
++
]
=
group
;
data
->
groups
[
data
->
num_attr_groups
++
]
=
&
nct6775_group_other
;
data
->
hwmon_dev
=
hwmon_device_register_with_groups
(
dev
,
data
->
name
,
data
,
data
->
groups
);
if
(
IS_ERR
(
data
->
hwmon_dev
))
return
PTR_ERR
(
data
->
hwmon_dev
);
return
0
;
}
static
int
nct6775_remove
(
struct
platform_device
*
pdev
)
{
struct
nct6775_data
*
data
=
platform_get_drvdata
(
pdev
);
hwmon_device_unregister
(
data
->
hwmon_dev
);
hwmon_dev
=
devm_hwmon_device_register_with_groups
(
dev
,
data
->
name
,
data
,
data
->
groups
);
if
(
IS_ERR
(
hwmon_dev
))
return
PTR_ERR
(
hwmon_dev
);
return
0
;
}
...
...
@@ -3964,7 +3954,6 @@ static struct platform_driver nct6775_driver = {
.
pm
=
NCT6775_DEV_PM_OPS
,
},
.
probe
=
nct6775_probe
,
.
remove
=
nct6775_remove
,
};
static
const
char
*
const
nct6775_sio_names
[]
__initconst
=
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment