Received: by 10.213.65.68 with SMTP id h4csp538185imn; Fri, 16 Mar 2018 10:48:24 -0700 (PDT) X-Google-Smtp-Source: AG47ELsIUTZtD0PkA6mYC/JD+CElHI9Oi53j3GxNSlnRAuK134GBY8EUd+ouUwtwWqGkfqslbUBG X-Received: by 10.98.40.197 with SMTP id o188mr2236567pfo.89.1521222504820; Fri, 16 Mar 2018 10:48:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521222504; cv=none; d=google.com; s=arc-20160816; b=uVwfdraNeNiyiUrjeEEoijbwS4WW3+2dCDx0Jlh9C/32zc4c9oYHLlfEYwF+2f7Nn6 TzMNt/ETp33L3WRq2+MAuDWSReDy59FfIgC7bHlyxZw3Jjn68Sp5OSLssTnqc4dIKI5P hvpBCRPn1UkT0eNd5uAixg4/DL98tja3ryB/sFB4Ky8I1OwHxQRL9x3Bo230MXYB93aJ MNX4Twq2H0XD1lR7mO6u3t84sDP+o8OxZo7AhGcJu8Loi6muB4n/a4vHUJqn301T/MtL nWdWqtSN4qwyroX8awieAg0X2B0KIFBTzTLlU4l+W/b+lQkKzHr7nKoCkNqxFsF7Yn3D WHRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:references:in-reply-to:mime-version :dkim-signature:arc-authentication-results; bh=SWmZVvPV8VlZGNfOdDqAZ7NT2MVqnf0BPmO+fFrcv9c=; b=xzv0OnrKmpNsjPINNC+ZdE+/rTcx1rkEiT6ve4HOYe3OHmWCQY3zdsXmLI5UBUqity YoxAWASG6MBryGql8i9PgGkMghZ2fmoIYmCrcCR8rAqq5Qe8QQnP82neDvRvoM3hcRtN 2Hb0bMN+9ZEzejr5PHzt9gRJBDd527CKKhPePZk/D4Kiwe9haUDNWaM2qRQ9P8BqAayC /qTwHQRmCMV+KVJytkqPH5h2NGd+RQRJgDKi09eahK18sT8hJFmtXr6zLQiv0/p05pdx S8bsYP/6k/eMlLBO0PRFGKQ0vB0iSbGVAv+sh/0cjkeXkQ+6Ir4YZiABJI1Px4zTwg+n IZsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=JXX4BhFC; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q11si5193906pgv.144.2018.03.16.10.48.09; Fri, 16 Mar 2018 10:48:24 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=JXX4BhFC; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752465AbeCPRrE (ORCPT + 99 others); Fri, 16 Mar 2018 13:47:04 -0400 Received: from mail-qt0-f196.google.com ([209.85.216.196]:38860 "EHLO mail-qt0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752106AbeCPRrC (ORCPT ); Fri, 16 Mar 2018 13:47:02 -0400 Received: by mail-qt0-f196.google.com with SMTP id n12so11717881qtl.5; Fri, 16 Mar 2018 10:47:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=SWmZVvPV8VlZGNfOdDqAZ7NT2MVqnf0BPmO+fFrcv9c=; b=JXX4BhFCcW0xrIvlG0ILr1Mhl2HFiZSNq22AIi52woaBO0yHq2gsSgQ/2APHJnP7qZ OXbfC1xRZxVGsH0hJTyNNIDzrYx1iS3QpINhqpuQGo5T8dgwmscBK0YQZevQwjaC8h+m H929G6t6veX/UJtAz674yvFVnJnyh31VptNTiYxfcTZmbrZjioHG3h+18+917jycS057 Iih3Eo/u5AbcipJX5K8b2jhs3aMCd9uJIq5kdepPMD6tR90R7AG5g/cx12M1+34kkxOP TWemrjKtiqgICOLtxscIfwYZUi8no7HcUhMGZMkByH1dSE18OwbXcSIIy5K1g0qJ7Mqf N6Uw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=SWmZVvPV8VlZGNfOdDqAZ7NT2MVqnf0BPmO+fFrcv9c=; b=hFZSQAFGtdyoc9P6Vbx4kUQvasu51ertCyQ88QYy49ZNoUBQq6hIJZCrwfPflu+VNJ xnorckMymciEXJenpt3m/4eMo2r/1M5cxVm62YBk7WdCHZS/yOe3s0Fww4sh27+4vZk5 LXqyBdyqvIt6zwgVmQZ59Bq5Z7NhfWLEdLzEC0tyw/xDpXFhaLnr/HByNy3jSZmwfDvx rXuAtiROwiBdrLlLiXOQMsXGKxyDeoSz0tnAg3MwezXrYi2ZoUbE7i++Bmpb2FnwAidy ZIba1vEcH1VZMQXRwRwZbpMQhnNPjWNrdu4gKreXjUSvq7T4iqseE0gz1YkYuh+URU+U v4Hg== X-Gm-Message-State: AElRT7GzxcKyYzudeQrl0I82gK3JZF28pji/iMIdE8HGoj9U1zX5nSpN qPFP4l/HS/uTCFVblRPhfOrllwEvOEFCXZatgMk= X-Received: by 10.237.53.231 with SMTP id d36mr3875593qte.276.1521222421941; Fri, 16 Mar 2018 10:47:01 -0700 (PDT) MIME-Version: 1.0 Received: by 10.237.55.130 with HTTP; Fri, 16 Mar 2018 10:47:01 -0700 (PDT) In-Reply-To: <20180316150555.GE11689@kuha.fi.intel.com> References: <1521191569-21221-1-git-send-email-leechu729@gmail.com> <20180316150555.GE11689@kuha.fi.intel.com> From: =?UTF-8?B?5p2O5pu45biG?= Date: Sat, 17 Mar 2018 01:47:01 +0800 Message-ID: Subject: Re: [PATCH] staging: typec: rt1711h typec chip driver To: Heikki Krogerus Cc: Greg KH , Guenter Roeck , =?UTF-8?B?c2h1ZmFuX2xlZSjmnY7mm7jluIYp?= , =?UTF-8?B?Y3lfaHVhbmco6buD5ZWf5Y6fKQ==?= , Jun Li , linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Heikki, 2018-03-16 23:05 GMT+08:00 Heikki Krogerus : > Hi ShuFan, > > On Fri, Mar 16, 2018 at 05:12:49PM +0800, ShuFan Lee wrote: >> +static int rt1711h_init_gpio(struct rt1711h_chip *chip) >> +{ >> + int ret; >> + struct device_node *np =3D chip->dev->of_node; >> + >> + ret =3D of_get_named_gpio(np, "rt,intr_gpio", 0); >> + if (ret < 0) { >> + dev_err(chip->dev, "%s get int gpio fail(%d)\n", __func__,= ret); >> + return ret; >> + } >> + chip->irq_gpio =3D ret; >> + >> + ret =3D devm_gpio_request_one(chip->dev, chip->irq_gpio, GPIOF_IN, >> + dev_name(chip->dev)); >> + if (ret < 0) { >> + dev_err(chip->dev, "%s request gpio fail(%d)\n", __func__,= ret); >> + return ret; >> + } >> + >> + chip->irq =3D gpio_to_irq(chip->irq_gpio); >> + if (chip->irq <=3D 0) { >> + dev_err(chip->dev, "%s gpio2irq fail(%d)\n", __func__, >> + chip->irq); >> + return -EINVAL; >> + } >> + return 0; > > "rt,intr_gpio" should probable be "rt,intr-gpio". Then this function > can be prepared for all types of platforms: > > static int rt1711h_init_gpio(struct rt1711h_chip *chip) > { > struct gpio_desc *gpio; > > gpio =3D devm_gpiod_get(chip->dev, "rt,intr", GFP_KERNEL); > if (IS_ERR(gpio)) > return PTR_ERR(gpio); > > chip->irq =3D gpiod_to_irq(gpio); > if (chip->irq < 0) > return chip->irq; > > return 0; > } > > > Thanks, > > -- > heikki Thank you, I've changed it in PATCH v2. May I add you to Suggested-by list? --=20 Best Regards, =E6=9B=B8=E5=B8=86