isl: Convert driver to CTLFLAG_MPSAFE
Replace CTLFLAG_NEEDGIANT with CTLFLAG_MPSAFE for all light sensor sysctls. All of the sysctl handlers are serialized by a driver mutex. Sysctls converted: - dev.isl.X.als (ambient light sensor) - dev.isl.X.ir (infrared sensor) - dev.isl.X.prox (proximity sensor) - dev.isl.X.resolution (sensor resolution) - dev.isl.X.range (sensor range) Reviewed by: markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D54621
This commit is contained in:
committed by
Mark Johnston
parent
c2a55efd74
commit
0672e0e38a
+5
-5
@@ -202,7 +202,7 @@ isl_attach(device_t dev)
|
||||
if (use_als) {
|
||||
SYSCTL_ADD_PROC(sysctl_ctx,
|
||||
SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, "als",
|
||||
CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc,
|
||||
CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, sc,
|
||||
ISL_METHOD_ALS, isl_sysctl, "I",
|
||||
"Current ALS sensor read-out");
|
||||
}
|
||||
@@ -210,7 +210,7 @@ isl_attach(device_t dev)
|
||||
if (use_ir) {
|
||||
SYSCTL_ADD_PROC(sysctl_ctx,
|
||||
SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, "ir",
|
||||
CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc,
|
||||
CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, sc,
|
||||
ISL_METHOD_IR, isl_sysctl, "I",
|
||||
"Current IR sensor read-out");
|
||||
}
|
||||
@@ -218,20 +218,20 @@ isl_attach(device_t dev)
|
||||
if (use_prox) {
|
||||
SYSCTL_ADD_PROC(sysctl_ctx,
|
||||
SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, "prox",
|
||||
CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc,
|
||||
CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, sc,
|
||||
ISL_METHOD_PROX, isl_sysctl, "I",
|
||||
"Current proximity sensor read-out");
|
||||
}
|
||||
|
||||
SYSCTL_ADD_PROC(sysctl_ctx,
|
||||
SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, "resolution",
|
||||
CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc,
|
||||
CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, sc,
|
||||
ISL_METHOD_RESOLUTION, isl_sysctl, "I",
|
||||
"Current proximity sensor resolution");
|
||||
|
||||
SYSCTL_ADD_PROC(sysctl_ctx,
|
||||
SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, "range",
|
||||
CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc,
|
||||
CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, sc,
|
||||
ISL_METHOD_RANGE, isl_sysctl, "I",
|
||||
"Current proximity sensor range");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user