nfit.c (bc9775d8697f57b333b6b316fb5145d6ca9dc36d) | nfit.c (58cd71b4747432b0ef3b86db1b09c12e6c97204b) |
---|---|
1/* 2 * Copyright(c) 2013-2015 Intel Corporation. All rights reserved. 3 * 4 * This program is free software; you can redistribute it and/or modify 5 * it under the terms of version 2 of the GNU General Public License as 6 * published by the Free Software Foundation. 7 * 8 * This program is distributed in the hope that it will be useful, but --- 1451 unchanged lines hidden (view full) --- 1460 nfit_test->setup(nfit_test); 1461 acpi_desc = &nfit_test->acpi_desc; 1462 acpi_nfit_desc_init(acpi_desc, &pdev->dev); 1463 acpi_desc->blk_do_io = nfit_test_blk_do_io; 1464 nd_desc = &acpi_desc->nd_desc; 1465 nd_desc->provider_name = NULL; 1466 nd_desc->module = THIS_MODULE; 1467 nd_desc->ndctl = nfit_test_ctl; | 1/* 2 * Copyright(c) 2013-2015 Intel Corporation. All rights reserved. 3 * 4 * This program is free software; you can redistribute it and/or modify 5 * it under the terms of version 2 of the GNU General Public License as 6 * published by the Free Software Foundation. 7 * 8 * This program is distributed in the hope that it will be useful, but --- 1451 unchanged lines hidden (view full) --- 1460 nfit_test->setup(nfit_test); 1461 acpi_desc = &nfit_test->acpi_desc; 1462 acpi_nfit_desc_init(acpi_desc, &pdev->dev); 1463 acpi_desc->blk_do_io = nfit_test_blk_do_io; 1464 nd_desc = &acpi_desc->nd_desc; 1465 nd_desc->provider_name = NULL; 1466 nd_desc->module = THIS_MODULE; 1467 nd_desc->ndctl = nfit_test_ctl; |
1468 acpi_desc->nvdimm_bus = nvdimm_bus_register(&pdev->dev, nd_desc); 1469 if (!acpi_desc->nvdimm_bus) 1470 return -ENXIO; | |
1471 1472 rc = acpi_nfit_init(acpi_desc, nfit_test->nfit_buf, 1473 nfit_test->nfit_size); | 1468 1469 rc = acpi_nfit_init(acpi_desc, nfit_test->nfit_buf, 1470 nfit_test->nfit_size); |
1474 if (rc) { 1475 nvdimm_bus_unregister(acpi_desc->nvdimm_bus); | 1471 if (rc) |
1476 return rc; | 1472 return rc; |
1477 } | |
1478 1479 if (nfit_test->setup != nfit_test0_setup) 1480 return 0; 1481 1482 nfit_test->setup_hotplug = 1; 1483 nfit_test->setup(nfit_test); 1484 1485 rc = acpi_nfit_init(acpi_desc, nfit_test->nfit_buf, 1486 nfit_test->nfit_size); | 1473 1474 if (nfit_test->setup != nfit_test0_setup) 1475 return 0; 1476 1477 nfit_test->setup_hotplug = 1; 1478 nfit_test->setup(nfit_test); 1479 1480 rc = acpi_nfit_init(acpi_desc, nfit_test->nfit_buf, 1481 nfit_test->nfit_size); |
1487 if (rc) { 1488 nvdimm_bus_unregister(acpi_desc->nvdimm_bus); | 1482 if (rc) |
1489 return rc; | 1483 return rc; |
1490 } | |
1491 1492 return 0; 1493} 1494 1495static int nfit_test_remove(struct platform_device *pdev) 1496{ | 1484 1485 return 0; 1486} 1487 1488static int nfit_test_remove(struct platform_device *pdev) 1489{ |
1497 struct nfit_test *nfit_test = to_nfit_test(&pdev->dev); 1498 struct acpi_nfit_desc *acpi_desc = &nfit_test->acpi_desc; 1499 1500 nvdimm_bus_unregister(acpi_desc->nvdimm_bus); 1501 | |
1502 return 0; 1503} 1504 1505static void nfit_test_release(struct device *dev) 1506{ 1507 struct nfit_test *nfit_test = to_nfit_test(dev); 1508 1509 kfree(nfit_test); --- 92 unchanged lines hidden --- | 1490 return 0; 1491} 1492 1493static void nfit_test_release(struct device *dev) 1494{ 1495 struct nfit_test *nfit_test = to_nfit_test(dev); 1496 1497 kfree(nfit_test); --- 92 unchanged lines hidden --- |