diff options
author | Kylene Jo Hall <kjhall@us.ibm.com> | 2005-11-07 00:59:25 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-11-07 07:53:36 -0800 |
commit | e2a8f7a129aff5173c238c8896f004e07a2a3abe (patch) | |
tree | ad6be2d5d3799c356cbb92f7859b01c9b038ccfb /fs | |
parent | ccb6e363a68144cdfdaa6d964d63d620c8ac9a9b (diff) |
[PATCH] tpm: Fix lack of driver_unregister in init failcases
driver_unregister is not being properly called when the init function
returns an error case. Restructured the return logic such that this and
the other cleanups all happen in one place. Preformed many of the cleanups
that Andrew Morton's patch on Thursday made in tpm_atmel.c. Fixed
Matthieu's concern about writing before discovery.
(akpm: rmk said:
This driver is buggy. You must not provide your own release function - it
doesn't solve the problem which the warning (which you get when you don't
provide one) is telling you about.
You should convert your device driver over to the replacement dynamic platform
support, once it is merged. IOW, something like:
pdev = platform_device_alloc("mydev", id);
if (pdev) {
err = platform_device_add_resources(pdev, &resources,
ARRAY_SIZE(resources));
if (err == 0)
err = platform_device_add_data(pdev, &platform_data,
sizeof(platform_data));
if (err == 0)
err = platform_device_add(pdev);
} else {
err = -ENOMEM;
}
if (err)
platform_device_put(pdev);
)
Signed-off-by: Kylene Jo Hall <kjhall@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs')
0 files changed, 0 insertions, 0 deletions