From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.2 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C485DC433E0 for ; Tue, 16 Jun 2020 11:02:33 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 94BEC207C4 for ; Tue, 16 Jun 2020 11:02:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="do7COY9K" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 94BEC207C4 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ucw.cz Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=2RrxfL/UTYu4VN4dXpw+h8UGep835i0qLu+jpVUeqT8=; b=do7COY9KnWTxi2 Ybwz1yUHGmmvzFaEbNsrhhoBlVSD3rrr3vFdoKuIJC8YkYF9Mb6sOhrQ9D0+WdMW1nV8b7B9SMqKx FQoasMpWgCovwsTiDFnQZsJQ0X0oGLerYdJ2lE7ZOHD9Gcr4EfuTch32TY8LzV3WSqKG0PnIlxQcd KCV65AJzBAmehrcxuIcd3RgOWDih9UFs5XfCBebG4rjPE80O5KbNQulGo6kXMy9a1Te0sT+qqFGPg UjWNM/wP59xKGhW1XcimgPgHPdRyzXkrOxnClokQ3kn9L/q0BqoeeFoWhvF35IIqydCNvbPn0THUN 15rys6BRk19SbNFN1Bjg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jl9MJ-0001ru-G1; Tue, 16 Jun 2020 11:02:27 +0000 Received: from jabberwock.ucw.cz ([46.255.230.98]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jl9MG-0001rK-F0; Tue, 16 Jun 2020 11:02:25 +0000 Received: by jabberwock.ucw.cz (Postfix, from userid 1017) id 3FC5A1C0C0F; Tue, 16 Jun 2020 13:02:23 +0200 (CEST) Date: Tue, 16 Jun 2020 13:02:16 +0200 From: Pavel Machek To: Fengping Yu Subject: Re: [PATCH v1 2/3] drivers: input: misc: Add mtk vibrator driver Message-ID: <20200616110216.GK1718@bug> References: <20200615114203.116656-1-fengping.yu@mediatek.com> <20200615114203.116656-3-fengping.yu@mediatek.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200615114203.116656-3-fengping.yu@mediatek.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200616_040224_647853_8BB902AE X-CRM114-Status: UNSURE ( 9.35 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Catalin Marinas , Dmitry Torokhov , linux-mediatek@lists.infradead.org, Jacek Anaszewski , linux-input@vger.kernel.org, Matthias Brugger , Yingjoe Chen , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi! > +static int mt_vibra_parse_dt(struct device *dev, > + struct reg_vibr_config *vibr_conf) > +{ > + int ret; > + > + if (device_property_read_u32(dev, "min-limit", > + &vibr_conf->min_limit)) > + vibr_conf->min_limit = DEFAULT_MIN_LIMIT; > + vibr_conf->min_limit = max_t(unsigned int, > + vibr_conf->min_limit, DEFAULT_MIN_LIMIT); > + > + if (device_property_read_u32(dev, "max-limit", > + &vibr_conf->max_limit)) > + vibr_conf->max_limit = 0; Is max_limit useful? Do you enforce it in useful way? > + if (!vibr_conf->max_limit && > + vibr_conf->max_limit < vibr_conf->min_limit) { > + dev_err(dev, "error load dts: get error limitation(min > max)\n"); > + return -EINVAL; > + } Condition looks wrong. > +static struct attribute *sysfs_attrs[] = { + &dev_attr_activate.attr, + > &dev_attr_state.attr, + &dev_attr_duration.attr, + NULL, +}; + +static struct > attribute_group vibr_group = { + .attrs = sysfs_attrs, +}; + +static int > regulator_oc_event(struct notifier_block *nb, + unsigned long event, void *data) +{ + Do you need custom attributes? Why? Where is their documentation? Pavel -- (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel