Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp4058547ybi; Tue, 18 Jun 2019 11:02:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqzlAc0OLbarjWlgGNiAk6F/PSuL0j+smiuanGJQcX0EK1JOsLC5uSxU5Bv1pX3poUULdgxk X-Received: by 2002:a17:90a:f488:: with SMTP id bx8mr6391527pjb.91.1560880947349; Tue, 18 Jun 2019 11:02:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560880947; cv=none; d=google.com; s=arc-20160816; b=etaVlA2AGftOhHBN1CwAcAzl9EmgJ1tqsGVJX5kFHZOUta/0YZOcI2+N4uGzTLZ8Cz x5A/mHsLSnNtAhrL6Bg/MK4o6AdXLmAwYV8hYvxQvouvhg4KcWIDGzXdhW83B1pOfj7b NqIU5uCpVpvfa86Y7dGL2QIdY00iZr7N1SfqoHrcYg1QHYKTMmlWkGjSOe5fi3kavoqV dqneHRn00huyGPwxKY/cbP1/+8YdMtK+RSWKpuG+cvYYHmd+NhA0WBXsDR8l8okrwaxG lMFzXtRyWfFRSa9rkhCC+74oUTZ7En+kCsrdmP3RhK9C++klMz0cLQjwKrhBJR7mrkox 8c9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=4TRvD1f7mrzpWOl3NEs7czvhz+VRSz0lAkw6qBXnFLE=; b=g31l8KM13/Q33GrJ3Udly0Asm38++mHBSOvn0FEn8WlyxcqpnzdQbZUUhhy6/+CyoF YD9Y1s2ZYcjcs9gwcC6iuBoOZBuCZqK1Ha4u+xlZp6KT6ZxhLtI/S/zYtTn5AjO+Aq9I FFhgrHTcdrS7jx/Xi8RIfZudhlcjWj62AFlV3MYwHh+sgEiOMhshc6h+q4YAT1BcEZdQ Fq6c2vrWiUOvMhGWaZbr3E2tJOfYfQlTVhy2fP8y9EGeTc/QN5+8JaoAUc7fyozYWQF+ MtXfoeJKWeYIhyRYEv7QWYIjL5PapMZwVwfNhS8ax9tKERnzhbyxoLHDozDMcJE0++83 rRBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=j9e6WBhg; 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=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y8si12924600plk.428.2019.06.18.11.02.10; Tue, 18 Jun 2019 11:02:27 -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=@chromium.org header.s=google header.b=j9e6WBhg; 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=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729947AbfFRSB1 (ORCPT + 99 others); Tue, 18 Jun 2019 14:01:27 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:44636 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729586AbfFRSB1 (ORCPT ); Tue, 18 Jun 2019 14:01:27 -0400 Received: by mail-wr1-f65.google.com with SMTP id r16so452634wrl.11 for ; Tue, 18 Jun 2019 11:01:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=4TRvD1f7mrzpWOl3NEs7czvhz+VRSz0lAkw6qBXnFLE=; b=j9e6WBhgGb2m272a9Ty7hK1Ru1Z8Et6pItbk3oLasaW5jrj9fVMlunQDavatnrdA33 nzb+9HMIHPnH0Bnc8VFVGe38iQgbZxOUWbgSvfQgbfW8Vg2kHgOHg82aiuJqUfiLiQXr OmIJ73VMFS+TMf2dz94G4VDkLJiq4ACZ7CDus= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=4TRvD1f7mrzpWOl3NEs7czvhz+VRSz0lAkw6qBXnFLE=; b=ZGWyfX4Pn0FgHfNRYrEhLJz8IESMeM/6l8Mly5eCIm0RorPZQFlyG0yy+5qLT38m2+ QNDPGR8eF/sqCfDl41G29+JUbsD7JsZCKkU42cvpgzEUw9yqn8M64MbnI/6TSvPhkQ+t RIaofYNHuFW9Bgpd9MiQ1T8CoGEoYuvE6Wk5iINZoqhMgEXTf+N/0zy24zDU2ZZTUaxR 2dGpRbk2E5tIw3YwHYRnhB9A7V9oqN4v4yg8vwRmKymvGWYaRVjrwoaMInGoM1tBwUzb iTfcoTPs26eMafeo+a1gAG/nejYG7AN++H6qxQpgOwd7LdDhqV5Y3fvrL6fFtgNv71sj FLlg== X-Gm-Message-State: APjAAAX0HL6LNO3FMK7NGFSwNBAjEpbrlGaYiEk4SrfjwOce/alTulpx H8EIXvm98Vml7EeKIEcUCdPf9P6aQC9+VsosClBK1w== X-Received: by 2002:adf:ff84:: with SMTP id j4mr4994173wrr.71.1560880885230; Tue, 18 Jun 2019 11:01:25 -0700 (PDT) MIME-Version: 1.0 References: <20190614194854.208436-1-fletcherw@chromium.org> <20190614194854.208436-4-fletcherw@chromium.org> <4e560e12-4c20-8d5d-b3f9-587a55da279d@intel.com> In-Reply-To: <4e560e12-4c20-8d5d-b3f9-587a55da279d@intel.com> From: Fletcher Woodruff Date: Tue, 18 Jun 2019 12:00:59 -0600 Message-ID: Subject: Re: [PATCH v7 3/4] ASoC: rt5677: clear interrupts by polarity flip To: Cezary Rojewski Cc: linux-kernel@vger.kernel.org, Jaroslav Kysela , Liam Girdwood , Mark Brown , Oder Chiou , Takashi Iwai , Curtis Malainey , Ross Zwisler , alsa-devel@alsa-project.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jun 16, 2019 at 10:56 AM Cezary Rojewski wrote: > On 2019-06-14 21:48, Fletcher Woodruff wrote: > > +static irqreturn_t rt5677_irq(int unused, void *data) > > +{ > > + struct rt5677_priv *rt5677 = data; > > + int ret = 0, i, reg_irq, virq; > > + bool irq_fired = false; > > + > > + mutex_lock(&rt5677->irq_lock); > > + /* Read interrupt status */ > > + ret = regmap_read(rt5677->regmap, RT5677_IRQ_CTRL1, ®_irq); > > + if (ret) { > > + pr_err("rt5677: failed reading IRQ status: %d\n", ret); > > The entire rt5677 makes use of dev_XXX with the exception of.. this very > function. Consider reusing "component" field which is already part of > struct rt5677_priv and removing pr_XXX. I was using dev_XXX, but I believe Curtis found that 'component' was sometimes uninitialized when this function was called, so I switched back to pr_XXX. I may be misremembering though, so I'll let Curtis comment as well. > > + if (ret) { > > + dev_err(&i2c->dev, "Failed to request IRQ: %d\n", ret); > > return ret; > > You may want to simplify this, similarly to how's it done in your > rt5677_i2c_probe - leave message alone and return "ret" explicitly at > the end. Good suggestion. I'll update that for the next patch.