Home
last modified time | relevance | path

Searched hist:e2a8f7a129aff5173c238c8896f004e07a2a3abe (Results 1 – 1 of 1) sorted by relevance

/linux/drivers/char/tpm/
H A Dtpm_nsc.cdiff e2a8f7a129aff5173c238c8896f004e07a2a3abe Mon Nov 07 09:59:25 CET 2005 Kylene Jo Hall <kjhall@us.ibm.com> [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>