Skip to content

Commit 5f15551

Browse files
Wang Qingrafaeljw
authored andcommitted
ACPI: NFIT: Use kobj_to_dev() instead
Use kobj_to_dev() instead of container_of() Signed-off-by: Wang Qing <wangqing@vivo.com> Acked-by: Vishal Verma <vishal.l.verma@intel.com> [ rjw: Subject edits ] Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent 856deb8 commit 5f15551

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/acpi/nfit/core.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1389,7 +1389,7 @@ static bool ars_supported(struct nvdimm_bus *nvdimm_bus)
13891389

13901390
static umode_t nfit_visible(struct kobject *kobj, struct attribute *a, int n)
13911391
{
1392-
struct device *dev = container_of(kobj, struct device, kobj);
1392+
struct device *dev = kobj_to_dev(kobj);
13931393
struct nvdimm_bus *nvdimm_bus = to_nvdimm_bus(dev);
13941394

13951395
if (a == &dev_attr_scrub.attr)
@@ -1679,7 +1679,7 @@ static struct attribute *acpi_nfit_dimm_attributes[] = {
16791679
static umode_t acpi_nfit_dimm_attr_visible(struct kobject *kobj,
16801680
struct attribute *a, int n)
16811681
{
1682-
struct device *dev = container_of(kobj, struct device, kobj);
1682+
struct device *dev = kobj_to_dev(kobj);
16831683
struct nvdimm *nvdimm = to_nvdimm(dev);
16841684
struct nfit_mem *nfit_mem = nvdimm_provider_data(nvdimm);
16851685

0 commit comments

Comments
 (0)