/*
 * drv_configs.h: Interface to apply PMU specific configuration
 * Copyright (c) 2016-2018, Linaro Ltd.
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms and conditions of the GNU General Public License,
 * version 2, as published by the Free Software Foundation.
 *
 * This program is distributed in the hope it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
 * more details.
 *
 */

#include "drv_configs.h"
#include "evlist.h"
#include "evsel.h"
#include "pmu.h"

static int
perf_evsel__apply_drv_configs(struct perf_evsel *evsel,
			      struct perf_evsel_config_term **err_term)
{
	bool found = false;
	int err = 0;
	struct perf_evsel_config_term *term;
	struct perf_pmu *pmu = NULL;

	while ((pmu = perf_pmu__scan(pmu)) != NULL)
		if (pmu->type == evsel->attr.type) {
			found = true;
			break;
		}

	list_for_each_entry(term, &evsel->config_terms, list) {
		if (term->type != PERF_EVSEL__CONFIG_TERM_DRV_CFG)
			continue;

		/*
		 * We have a configuration term, report an error if we
		 * can't find the PMU or if the PMU driver doesn't support
		 * cmd line driver configuration.
		 */
		if (!found || !pmu->set_drv_config) {
			err = -EINVAL;
			*err_term = term;
			break;
		}

		err = pmu->set_drv_config(term);
		if (err) {
			*err_term = term;
			break;
		}
	}

	return err;
}

int perf_evlist__apply_drv_configs(struct perf_evlist *evlist,
				   struct perf_evsel **err_evsel,
				   struct perf_evsel_config_term **err_term)
{
	struct perf_evsel *evsel;
	int err = 0;

	evlist__for_each_entry(evlist, evsel) {
		err = perf_evsel__apply_drv_configs(evsel, err_term);
		if (err) {
			*err_evsel = evsel;
			break;
		}
	}

	return err;
}
ux/net-next.git/tree/net/sched/sch_codel.c?h=nds-private-remove&amp;id=a158aeaf5bb5b014240b360693751476aca7440b'>tree</a><a href='/cgit.cgi/linux/net-next.git/commit/net/sched/sch_codel.c?h=nds-private-remove&amp;id=a158aeaf5bb5b014240b360693751476aca7440b'>commit</a><a href='/cgit.cgi/linux/net-next.git/diff/net/sched/sch_codel.c?h=nds-private-remove&amp;id=a158aeaf5bb5b014240b360693751476aca7440b'>diff</a></td><td class='form'><form class='right' method='get' action='/cgit.cgi/linux/net-next.git/log/net/sched/sch_codel.c'>
<input type='hidden' name='h' value='nds-private-remove'/><input type='hidden' name='id' value='a158aeaf5bb5b014240b360693751476aca7440b'/><select name='qt'>
<option value='grep'>log msg</option>
<option value='author'>author</option>
<option value='committer'>committer</option>
<option value='range'>range</option>
</select>
<input class='txt' type='search' size='10' name='q' value=''/>
<input type='submit' value='search'/>
</form>
</td></tr></table>
<div class='path'>path: <a href='/cgit.cgi/linux/net-next.git/log/?h=nds-private-remove&amp;id=a158aeaf5bb5b014240b360693751476aca7440b'>root</a>/<a href='/cgit.cgi/linux/net-next.git/log/net?h=nds-private-remove&amp;id=a158aeaf5bb5b014240b360693751476aca7440b'>net</a>/<a href='/cgit.cgi/linux/net-next.git/log/net/sched?h=nds-private-remove&amp;id=a158aeaf5bb5b014240b360693751476aca7440b'>sched</a>/<a href='/cgit.cgi/linux/net-next.git/log/net/sched/sch_codel.c?h=nds-private-remove&amp;id=a158aeaf5bb5b014240b360693751476aca7440b'>sch_codel.c</a></div><div class='content'><table class='list nowrap'><tr class='nohover'><th class='left'>Age</th><th class='left'>Commit message (<a href='/cgit.cgi/linux/net-next.git/log/net/sched/sch_codel.c?h=nds-private-remove&amp;id=a158aeaf5bb5b014240b360693751476aca7440b&amp;showmsg=1'>Expand</a>)</th><th class='left'>Author</th><th class='left'>Files</th><th class='left'>Lines</th></tr>
'/><input type='hidden' name='id' value='d07830db1bdb254e4b50d366010b219286b8c937'/><table><tr><td colspan='2'/></tr><tr><td class='label'>context:</td><td class='ctrl'><select name='context' onchange='this.form.submit();'><option value='1'>1</option><option value='2'>2</option><option value='3' selected='selected'>3</option><option value='4'>4</option><option value='5'>5</option><option value='6'>6</option><option value='7'>7</option><option value='8'>8</option><option value='9'>9</option><option value='10'>10</option><option value='15'>15</option><option value='20'>20</option><option value='25'>25</option><option value='30'>30</option><option value='35'>35</option><option value='40'>40</option></select></td></tr><tr><td class='label'>space:</td><td class='ctrl'><select name='ignorews' onchange='this.form.submit();'><option value='0' selected='selected'>include</option><option value='1'>ignore</option></select></td></tr><tr><td class='label'>mode:</td><td class='ctrl'><select name='dt' onchange='this.form.submit();'><option value='0' selected='selected'>unified</option><option value='1'>ssdiff</option><option value='2'>stat only</option></select></td></tr><tr><td/><td class='ctrl'><noscript><input type='submit' value='reload'/></noscript></td></tr></table></form></div><table summary='commit info' class='commit-info'>
<tr><th>author</th><td>Marcel J.E. Mol &lt;marcel@mesa.nl&gt;</td><td class='right'>2017-01-30 19:26:40 +0100</td></tr>
<tr><th>committer</th><td>Johan Hovold &lt;johan@kernel.org&gt;</td><td class='right'>2017-01-31 17:27:04 +0100</td></tr>
<tr><th>commit</th><td colspan='2' class='oid'><a href='/cgit.cgi/linux/net-next.git/commit/sound/pci/asihpi/hpifunc.c?h=nds-private-remove&amp;id=d07830db1bdb254e4b50d366010b219286b8c937'>d07830db1bdb254e4b50d366010b219286b8c937</a> (<a href='/cgit.cgi/linux/net-next.git/patch/sound/pci/asihpi/hpifunc.c?id=d07830db1bdb254e4b50d366010b219286b8c937'>patch</a>)</td></tr>
<tr><th>tree</th><td colspan='2' class='oid'><a href='/cgit.cgi/linux/net-next.git/tree/?h=nds-private-remove&amp;id=d07830db1bdb254e4b50d366010b219286b8c937'>354d7fca237fa3d7e7e63c2196eaa4e1086838ea</a> /<a href='/cgit.cgi/linux/net-next.git/tree/sound/pci/asihpi/hpifunc.c?h=nds-private-remove&amp;id=d07830db1bdb254e4b50d366010b219286b8c937'>sound/pci/asihpi/hpifunc.c</a></td></tr>
<tr><th>parent</th><td colspan='2' class='oid'><a href='/cgit.cgi/linux/net-next.git/commit/sound/pci/asihpi/hpifunc.c?h=nds-private-remove&amp;id=5d03a2fd2292e71936c4235885c35ccc3c94695b'>5d03a2fd2292e71936c4235885c35ccc3c94695b</a> (<a href='/cgit.cgi/linux/net-next.git/diff/sound/pci/asihpi/hpifunc.c?h=nds-private-remove&amp;id=d07830db1bdb254e4b50d366010b219286b8c937&amp;id2=5d03a2fd2292e71936c4235885c35ccc3c94695b'>diff</a>)</td></tr></table>
<div class='commit-subject'>USB: serial: pl2303: add ATEN device ID</div><div class='commit-msg'>Seems that ATEN serial-to-usb devices using pl2303 exist with
different device ids. This patch adds a missing device ID so it
is recognised by the driver.

Signed-off-by: Marcel J.E. Mol &lt;marcel@mesa.nl&gt;
Cc: stable &lt;stable@vger.kernel.org&gt;
Signed-off-by: Johan Hovold &lt;johan@kernel.org&gt;
</div><div class='diffstat-header'><a href='/cgit.cgi/linux/net-next.git/diff/?h=nds-private-remove&amp;id=d07830db1bdb254e4b50d366010b219286b8c937'>Diffstat</a> (limited to 'sound/pci/asihpi/hpifunc.c')</div><table summary='diffstat' class='diffstat'>