From: Hans-Christian Egtvedt Date: Wed, 4 Feb 2009 23:12:17 +0000 (-0800) Subject: atmel-ssc: fix misuse of dev_dbg when requested ssc instance is not found X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=dfecb7164eb81fbfae93fee1ad1da2ac58bb224d;p=openwrt%2Fstaging%2Fblogic.git atmel-ssc: fix misuse of dev_dbg when requested ssc instance is not found The ssc pointer is not valid when the id is not found in the list. Convert the message from a debug one into an error message and avoid dereferencing the bad pointer. Signed-off-by: Hans-Christian Egtvedt Cc: Kay Sievers Cc: Huang Weiyi Acked-by: Haavard Skinnemoen Cc: David Brownell Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/misc/atmel-ssc.c b/drivers/misc/atmel-ssc.c index bf5e4d065436..558bf3f2c276 100644 --- a/drivers/misc/atmel-ssc.c +++ b/drivers/misc/atmel-ssc.c @@ -35,7 +35,7 @@ struct ssc_device *ssc_request(unsigned int ssc_num) if (!ssc_valid) { spin_unlock(&user_lock); - dev_dbg(&ssc->pdev->dev, "could not find requested device\n"); + pr_err("ssc: ssc%d platform device is missing\n", ssc_num); return ERR_PTR(-ENODEV); }