Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935089Ab3DPAxQ (ORCPT ); Mon, 15 Apr 2013 20:53:16 -0400 Received: from mailout2.samsung.com ([203.254.224.25]:19135 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934340Ab3DPAxO (ORCPT ); Mon, 15 Apr 2013 20:53:14 -0400 X-AuditID: cbfee691-b7f5f6d000002fda-82-516ca0f89365 From: Jingoo Han To: "'Andrew Morton'" , "'Andrew Bresticker'" Cc: linux-fbdev@vger.kernel.org, "'Richard Purdie'" , "'Florian Tobias Schandinat'" , linux-kernel@vger.kernel.org, "'Doug Anderson'" , "'Jingoo Han'" References: <1365705391-23181-1-git-send-email-abrestic@chromium.org> <1365711890-15168-1-git-send-email-abrestic@chromium.org> <20130415160632.99e867b25418189c95fbc826@linux-foundation.org> In-reply-to: <20130415160632.99e867b25418189c95fbc826@linux-foundation.org> Subject: Re: [PATCH v2] backlight: platform_lcd: introduce probe callback Date: Tue, 16 Apr 2013 09:53:12 +0900 Message-id: <001601ce3a3c$c5680360$50380a20$%han@samsung.com> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-index: Ac46LeKZhi0rVs/OTPqR9+ndlryezwADcJeQ Content-language: ko X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrFIsWRmVeSWpSXmKPExsVy+t8zfd0fC3ICDb79UbRY+f4vo8Wc9WvY LM4uO8hm0TnzGqPF5YWXWC1O9H1gtbi8aw6bxe5dT1kdODxmN1xk8fjwMc7jxIzfLB575v9g 9ejbsorR4/MmuQC2KC6blNSczLLUIn27BK6MO091Cj7yV5z9/pyxgfEyTxcjJ4eEgInE+dvf 2CBsMYkL99YD2VwcQgLLGCW2ruhngSn6teAGO0RiEaPEls6zzBDOL0aJv1P6mUCq2ATUJL58 OcwOYosIxEmc7XvFCFLELPCOUeLnjpssEB2HG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hAnGElsX3OREaJERGLfi3eMExiFZiGZNAvJpFlIJs1C0rKAkWUVo2hqQXJBcVJ6 rqFecWJucWleul5yfu4mRnCyeCa1g3Flg8UhRgEORiUe3gD5nEAh1sSy4spcoFc5mJVEeG9l AoV4UxIrq1KL8uOLSnNSiw8xJgP9OZFZSjQ5H5jI8kriDY1NzIwsjcwsjEzMzUkTVhLnPdBq HSgkkJ5YkpqdmlqQWgSzhYmDU6qB8eyHM6Ff/wqLPY48ZqGSz7hpWiXf7DkVKTEmPesy5PR5 F2Ve0HjUd43twbHa2oSfz1JbAgqX2bm3X+4IKY27afQmz8BmgUYK6w//Gy5FmbW9+4rOr/ti oNh6qqHH7nPZ1EuqnGvO/nr2vcg71yV2w4072rpbTJh9jh2O27NJ2ZhhqdiESc3tSizFGYmG WsxFxYkAzPD44FoDAAA= DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2218 Lines: 65 On Tuesday, April 16, 2013 8:07 AM, Andrew Morton wrote: > > On Thu, 11 Apr 2013 13:24:50 -0700 Andrew Bresticker wrote: > > > Platform LCD devices may need to do some device-specific > > initialization before they can be used (regulator or GPIO setup, > > for example), but currently the driver does not support any way of > > doing this. This patch adds a probe() callback to plat_lcd_data > > which platform LCD devices can set to indicate that device-specific > > initialization is needed. > > > > index 17a6b83..f46180e 100644 > > --- a/drivers/video/backlight/platform_lcd.c > > +++ b/drivers/video/backlight/platform_lcd.c > > @@ -86,6 +86,12 @@ static int platform_lcd_probe(struct platform_device *pdev) > > return -EINVAL; > > } > > > > + if (pdata->probe) { > > + err = pdata->probe(pdata); > > + if (err) > > + return err; > > + } > > + > > plcd = devm_kzalloc(&pdev->dev, sizeof(struct platform_lcd), > > GFP_KERNEL); > > if (!plcd) { > > diff --git a/include/video/platform_lcd.h b/include/video/platform_lcd.h > > index ad3bdfe..23864b2 100644 > > --- a/include/video/platform_lcd.h > > +++ b/include/video/platform_lcd.h > > @@ -15,6 +15,7 @@ struct plat_lcd_data; > > struct fb_info; > > > > struct plat_lcd_data { > > + int (*probe)(struct plat_lcd_data *); > > void (*set_power)(struct plat_lcd_data *, unsigned int power); > > int (*match_fb)(struct plat_lcd_data *, struct fb_info *); > > }; > > Sigh. I see that this entire interface has been lovingly undocumented. > It's an invitation for us to grow bugs, incompatibilities, leaks, etc. > > Possible example: what happens if pdata->probe does some resource > allocation or device initialisation which should be backed out if, say, > platform_lcd_probe() later fails? Hi Andrew, I agree with you. Indeed, the documentation is necessary. Andrew Bresticker, Would you make the document? It would be very helpful. Best regards, Jingoo Han -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/